You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
URL parts with multiple parameters is a common scenario, supported by every router I know of - for some reason, it doesn't work with this router.
I wrote the following failing test case:
$this->specify('should match multiple regexp in params', function () use ($router) {
$router->get('/archive/{year:^[0-9]+$}-{month:^[0-9]+$}-{day:^[0-9]+$}', 'archive');
$result = $router->resolve('GET', '/archive/2015-31-01');
$this->assertEquals('archive', $result['handler']);
$this->assertEquals('2015', $result['params']['year']);
$this->assertEquals('31', $result['params']['month']);
$this->assertEquals('01', $result['params']['day']);
});
Of course, you can work around this, by further parsing a matched parameter like for example {date:^[0-9]+\-[0-9]+\-[0-9]+$}, but it shouldn't be necessary. I think the assumption that every part is either a fixed string or a single parameter is too limited.
The text was updated successfully, but these errors were encountered:
URL parts with multiple parameters is a common scenario, supported by every router I know of - for some reason, it doesn't work with this router.
I wrote the following failing test case:
Of course, you can work around this, by further parsing a matched parameter like for example
{date:^[0-9]+\-[0-9]+\-[0-9]+$}
, but it shouldn't be necessary. I think the assumption that every part is either a fixed string or a single parameter is too limited.The text was updated successfully, but these errors were encountered: