{"action":"created","issue":{"url":"https://api.github.com/repos/slimphp/Slim/issues/1289","labels_url":"https://api.github.com/repos/slimphp/Slim/issues/1289/labels{/name}","comments_url":"https://api.github.com/repos/slimphp/Slim/issues/1289/comments","events_url":"https://api.github.com/repos/slimphp/Slim/issues/1289/events","html_url":"https://github.com/slimphp/Slim/issues/1289","id":87904266,"number":1289,"title":"Optional parameter in url","user":{"login":"silentworks","id":79497,"avatar_url":"https://avatars.githubusercontent.com/u/79497?v=3","gravatar_id":"","url":"https://api.github.com/users/silentworks","html_url":"https://github.com/silentworks","followers_url":"https://api.github.com/users/silentworks/followers","following_url":"https://api.github.com/users/silentworks/following{/other_user}","gists_url":"https://api.github.com/users/silentworks/gists{/gist_id}","starred_url":"https://api.github.com/users/silentworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silentworks/subscriptions","organizations_url":"https://api.github.com/users/silentworks/orgs","repos_url":"https://api.github.com/users/silentworks/repos","events_url":"https://api.github.com/users/silentworks/events{/privacy}","received_events_url":"https://api.github.com/users/silentworks/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/slimphp/Slim/labels/Slim%203","name":"Slim 3","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/slimphp/Slim/milestones/12","html_url":"https://github.com/slimphp/Slim/milestones/Version%203.0.0","labels_url":"https://api.github.com/repos/slimphp/Slim/milestones/12/labels","id":382879,"number":12,"title":"Version 3.0.0","description":"","creator":{"login":"codeguy","id":31677,"avatar_url":"https://avatars.githubusercontent.com/u/31677?v=3","gravatar_id":"","url":"https://api.github.com/users/codeguy","html_url":"https://github.com/codeguy","followers_url":"https://api.github.com/users/codeguy/followers","following_url":"https://api.github.com/users/codeguy/following{/other_user}","gists_url":"https://api.github.com/users/codeguy/gists{/gist_id}","starred_url":"https://api.github.com/users/codeguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeguy/subscriptions","organizations_url":"https://api.github.com/users/codeguy/orgs","repos_url":"https://api.github.com/users/codeguy/repos","events_url":"https://api.github.com/users/codeguy/events{/privacy}","received_events_url":"https://api.github.com/users/codeguy/received_events","type":"User","site_admin":false},"open_issues":6,"closed_issues":80,"state":"open","created_at":"2013-07-20T18:57:07Z","updated_at":"2015-06-15T16:53:54Z","due_on":null,"closed_at":null},"comments":12,"created_at":"2015-06-13T01:53:24Z","updated_at":"2015-06-16T13:38:24Z","closed_at":null,"body":"It would seem it currently isn't possible to add an optional paramater in the url if you are using urlFor to get the url via a named route.\r\n\r\n```php\r\n$app->get('/test/{param1}[/{optional:[A-Za-z]}]')->setName('test');\r\n\r\n$app->getContainer()['router']->urlFor('test', ['param1' => 'World']);\r\n```\r\n\r\nThis will throw an error because urlFor method does not know how to handle optional regex. I saw another project using FastRoute and they handle it using this regex https://github.com/mrjgreen/phroute/blob/master/src/Phroute/RouteParser.php#L23-L29"},"comment":{"url":"https://api.github.com/repos/slimphp/Slim/issues/comments/112433241","html_url":"https://github.com/slimphp/Slim/issues/1289#issuecomment-112433241","issue_url":"https://api.github.com/repos/slimphp/Slim/issues/1289","id":112433241,"user":{"login":"geggleto","id":4027602,"avatar_url":"https://avatars.githubusercontent.com/u/4027602?v=3","gravatar_id":"","url":"https://api.github.com/users/geggleto","html_url":"https://github.com/geggleto","followers_url":"https://api.github.com/users/geggleto/followers","following_url":"https://api.github.com/users/geggleto/following{/other_user}","gists_url":"https://api.github.com/users/geggleto/gists{/gist_id}","starred_url":"https://api.github.com/users/geggleto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geggleto/subscriptions","organizations_url":"https://api.github.com/users/geggleto/orgs","repos_url":"https://api.github.com/users/geggleto/repos","events_url":"https://api.github.com/users/geggleto/events{/privacy}","received_events_url":"https://api.github.com/users/geggleto/received_events","type":"User","site_admin":false},"created_at":"2015-06-16T13:38:24Z","updated_at":"2015-06-16T13:38:24Z","body":"In v2 the router did support them... "}}