Repository navigation
v3.0.0
[v3.0.0] - 10.08.2025
There has been one too many breaking changes for such a simple router. I am most certain this will be the last one. Since it's such a common use case, parameter names are now included in the lookup result.
Changed
- [BREAKING] Lookups now return parameters as a named array. Parameter names must start with a letter or underscore and only contain alphanumeric characters or underscores.
Improved
- Enhanced test suite and documentation.
Migration
Before:
$router->add('GET', '/users/:id', 'handler');
$result = $router->lookup('GET', '/users/123');
// $result['params'] = ['123']After:
$router->add('GET', '/users/:id', 'handler');
$result = $router->lookup('GET', '/users/123');
// $result['params'] = ['id' => '123']