TreeRoute icon indicating copy to clipboard operation
TreeRoute copied to clipboard

optional parameters

Open zaksmok opened this issue 9 years ago • 0 comments

How can I add optional parameter to url?

For example I want to handle 2 links on 1 method: /news/1 /news/1/some-title

so how should my code look?

$router->get('/news/{id:[0-9]+}[/title:[A-Z]+]', 'handler2');

zaksmok avatar May 09 '16 14:05 zaksmok