mixed find_route(
string
$url)
|
|
Find first route in route table with path that matches argument
First, assure that the route table $routes has at least one route by adding the default route if the table is empty. Then search the table to find the first route in the table whose path matches the argument $url. If $url is an empty string, it matches a path that is an empty string. Otherwise, try to match $url to the path part of the table entry according to Perl regular expression rules. If a matching route is found, return it any to the caller, and also save a copy in $selected_route; if no matching route is found return null.
Tags:
Parameters: