{"action":"opened","issue":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/12070","repository_url":"https://api.github.com/repos/yiisoft/yii2","labels_url":"https://api.github.com/repos/yiisoft/yii2/issues/12070/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/12070/comments","events_url":"https://api.github.com/repos/yiisoft/yii2/issues/12070/events","html_url":"https://github.com/yiisoft/yii2/issues/12070","id":169090915,"number":12070,"title":"Use of default parameters while URL creation.","user":{"login":"Kolyunya","id":2682768,"avatar_url":"https://avatars.githubusercontent.com/u/2682768?v=3","gravatar_id":"","url":"https://api.github.com/users/Kolyunya","html_url":"https://github.com/Kolyunya","followers_url":"https://api.github.com/users/Kolyunya/followers","following_url":"https://api.github.com/users/Kolyunya/following{/other_user}","gists_url":"https://api.github.com/users/Kolyunya/gists{/gist_id}","starred_url":"https://api.github.com/users/Kolyunya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kolyunya/subscriptions","organizations_url":"https://api.github.com/users/Kolyunya/orgs","repos_url":"https://api.github.com/users/Kolyunya/repos","events_url":"https://api.github.com/users/Kolyunya/events{/privacy}","received_events_url":"https://api.github.com/users/Kolyunya/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-03T09:46:55Z","updated_at":"2016-08-03T09:46:55Z","closed_at":null,"body":" Suppose we have a rule:\r\n~~~\r\n[\r\n    'pattern' => 'post/<page:\\d+>/<tag>',\r\n    'route' => 'post/index',\r\n    'defaults' => ['page' => 1],\r\n],\r\n~~~\r\nThis rule returns false while trying to create a URL without explicit `page` specification.\r\n~~~\r\n$rule->createUrl($manager, 'post/index', ['tag' => 'foo']); // false\r\n~~~ \r\nWhy can't we use default parameters in pattern while URL creation? Is it by design? \r\n\r\nIt seems to me that we should be able to use optional parameters both while URL creation and parsing."}}
{"actor":{"display_login":"Kolyunya"}}