Extends
lithium\core\StaticObject
Accepts an instance of `lithium\action\Request` (or a subclass) and matches it against each
route, in the order that the routes are connected.
Parameters
- object $request A request object containing URL and environment data.
Returns
array Returns an array of parameters specifying how the given request should be routed. The keys returned depend on the `Route` object that was matched, but typically include `'controller'` and `'action'` keys.Source
public static function parse($request) {
$orig = $request->params;
$url = $request->url;
foreach (static::$_configurations as $route) {
if (!$match = $route->parse($request, compact('url'))) {
continue;
}
$request = $match;
if ($route->canContinue() && isset($request->params['args'])) {
$url = '/' . join('/', $request->params['args']);
unset($request->params['args']);
continue;
}
return $request;
}
$request->params = $orig;
}