auraphp/Aura.Router — pull request #25 by pokmot (2013-04-20 20:00:24+00:00)
Title: Update Route.php to allow attach with empty path

In my app I need to be able to serve both "http://localhost/blog" as well as "http://localhost/blog/".

I want to use "$router->attach()" to group my routes together.

However, I discovered that this only allows me to match "http://localhost/blog/", with a trailing slash. If I try entering a path of "" to match without the trailing slash then the path_prefix is completely ignored and the route entry is left blank.

This goes against the concept that all routes in the "attach" group will have the path_prefix added.

With this modification, it will match on the route so for instance $router->attach('/blog', [ 'routes' => [ 'browse' => '' ] ]); will allow the route '/blog' to be matched.

This also eliminates the argument in a different pull request whether a route should or should not end with a trailing slash, as the developer can more easily implement both without affecting existing implementations, and keep it all within a single attach.