Parse URL components into GET parameters to allow routing of requests.
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


This class can be used to route requests to specific handlers. The general approach is to match the request URI against a set of regular expressions (routes). The routes are applied in the defined order. The first matching route is used. If no route matches or the request is empty, the fallback params (defined by setFallback()) are returned.

Named groups can and should be used. You still get numerical indexes when using named groups, though. The recognized groups, named or not, can be merged into $_GET. Like this you can either give parameters by path, e.g. "de_DE/index" or by query string, e.g. "?language=de_DE&page=index" and they'll be treated in the same way.


Named groups are defined like:


For example:


This match would be accessible via:


Simple usage example:

   'language' => 'en_EN',
   'page'     => 'index'