On the technical side, I have come to prefer using straight regular expressions for routes, rather than a dsl or made-up routing syntax a la rails. It's a relatively unknown feature of preg, but you can have named captures, that pretty much gives you all that you need. For example, here's a couple of routes from a recent application of mine:
$GLOBALS['ROUTES']['~^GET/devices/(?P<device_id>\d+)~'] = "devices/show";
$GLOBALS['ROUTES']['~^GET/devices~'] = 'devices/index';
My front controller is then just a loop over the routes, that will resolve first match.For example, a GET request to `/devices/1234` will resolve to the file `handlers/devices/show.php`, where `device_id` is available as a parameter.
Yes, the syntax is a bit awkward, but it's computationally efficient without a cache/compilation step and it's a standard language, rather than a proprietary one.