-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
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.
Metadata
Metadata
Assignees
Labels
No labels