Skip to content

FastRoute 0.4.0

Choose a tag to compare

@nikic nikic released this 08 Mar 18:12
· 184 commits to master since this release

This release adds support for registering a route for multiple HTTP methods at the same time, by passing an array for the method parameter of RouteCollector::addRoute(). For example:

/** @var RouteCollector $r */
$r->addRoute(['GET', 'POST'], '/foo/{bar}', 'handlerForGetAndPost');

// This is equivalent to:
$r->addRoute('GET', '/foo/{bar}', 'handlerForGetAndPost');
$r->addRoute('POST', '/foo/{bar}', 'handlerForGetAndPost');