Skip to content

FastRoute 0.6.0

Compare
Choose a tag to compare
@nikic nikic released this 24 Jun 15:08
· 168 commits to master since this release

Added support for trailing optional segments, for example the route

$r->addRoute('GET', '/foo[/{bar}[/{baz}]]', 'handler');

is equivalent to the three routes

$r->addRoute('GET', '/foo', 'handler');
$r->addRoute('GET', '/foo/{bar}', 'handler');
$r->addRoute('GET', '/foo/{bar}/{baz}', 'handler');

As a result of this additional the output format for RouteParser was changed to add another array level, which may need to be accounted for if you use a custom parser.