{"action":"created","issue":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/7157","repository_url":"https://api.github.com/repos/yiisoft/yii2","labels_url":"https://api.github.com/repos/yiisoft/yii2/issues/7157/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/7157/comments","events_url":"https://api.github.com/repos/yiisoft/yii2/issues/7157/events","html_url":"https://github.com/yiisoft/yii2/issues/7157","id":56470499,"number":7157,"title":"Url::canonical action params problem","user":{"login":"serhatozles","id":4962332,"avatar_url":"https://avatars.githubusercontent.com/u/4962332?v=3","gravatar_id":"","url":"https://api.github.com/users/serhatozles","html_url":"https://github.com/serhatozles","followers_url":"https://api.github.com/users/serhatozles/followers","following_url":"https://api.github.com/users/serhatozles/following{/other_user}","gists_url":"https://api.github.com/users/serhatozles/gists{/gist_id}","starred_url":"https://api.github.com/users/serhatozles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serhatozles/subscriptions","organizations_url":"https://api.github.com/users/serhatozles/orgs","repos_url":"https://api.github.com/users/serhatozles/repos","events_url":"https://api.github.com/users/serhatozles/events{/privacy}","received_events_url":"https://api.github.com/users/serhatozles/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/yiisoft/yii2/labels/status:to%20be%20verified","name":"status:to be verified","color":"fbca04"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/yiisoft/yii2/milestones/9","html_url":"https://github.com/yiisoft/yii2/milestones/2.0.x","labels_url":"https://api.github.com/repos/yiisoft/yii2/milestones/9/labels","id":831720,"number":9,"title":"2.0.x","description":"","creator":{"login":"cebe","id":189796,"avatar_url":"https://avatars.githubusercontent.com/u/189796?v=3","gravatar_id":"","url":"https://api.github.com/users/cebe","html_url":"https://github.com/cebe","followers_url":"https://api.github.com/users/cebe/followers","following_url":"https://api.github.com/users/cebe/following{/other_user}","gists_url":"https://api.github.com/users/cebe/gists{/gist_id}","starred_url":"https://api.github.com/users/cebe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cebe/subscriptions","organizations_url":"https://api.github.com/users/cebe/orgs","repos_url":"https://api.github.com/users/cebe/repos","events_url":"https://api.github.com/users/cebe/events{/privacy}","received_events_url":"https://api.github.com/users/cebe/received_events","type":"User","site_admin":false},"open_issues":422,"closed_issues":1,"state":"open","created_at":"2014-10-19T13:49:45Z","updated_at":"2016-09-02T12:10:07Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2015-02-04T02:17:03Z","updated_at":"2016-09-02T12:10:07Z","closed_at":"2016-09-02T12:10:07Z","body":"Hi,\r\nI want to get url canonical without page number link, but Url::canonical(); getting all url.\r\nI'm thinking, This may be something like this?\r\n```\r\npublic function canonical($options = []) {\r\n\t$params = Yii::$app->controller->actionParams;\r\n\r\n\tif (count($options) > 0):\r\n\t    foreach ($params as $key => $param):\r\n\t\tif (!in_array($key, $options)):\r\n\t\t    unset($params[$key]);\r\n\t\tendif;\r\n\t    endforeach;\r\n\tendif;\r\n\r\n\t$params[0] = Yii::$app->controller->getRoute();\r\n\r\n\treturn Yii::$app->getUrlManager()->\r\n\t\t\tcreateAbsoluteUrl($params);\r\n    }\r\n\r\nUrl::canonical(['seo']);\r\n```\r\nJust \"seo\" param accepting..??"},"comment":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/comments/244357740","html_url":"https://github.com/yiisoft/yii2/issues/7157#issuecomment-244357740","issue_url":"https://api.github.com/repos/yiisoft/yii2/issues/7157","id":244357740,"user":{"login":"klimov-paul","id":1482054,"avatar_url":"https://avatars.githubusercontent.com/u/1482054?v=3","gravatar_id":"","url":"https://api.github.com/users/klimov-paul","html_url":"https://github.com/klimov-paul","followers_url":"https://api.github.com/users/klimov-paul/followers","following_url":"https://api.github.com/users/klimov-paul/following{/other_user}","gists_url":"https://api.github.com/users/klimov-paul/gists{/gist_id}","starred_url":"https://api.github.com/users/klimov-paul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klimov-paul/subscriptions","organizations_url":"https://api.github.com/users/klimov-paul/orgs","repos_url":"https://api.github.com/users/klimov-paul/repos","events_url":"https://api.github.com/users/klimov-paul/events{/privacy}","received_events_url":"https://api.github.com/users/klimov-paul/received_events","type":"User","site_admin":false},"created_at":"2016-09-02T12:10:07Z","updated_at":"2016-09-02T12:10:07Z","body":"Unable to reproduce.\r\n`Url::canonical()` picks only those request params bound to the controller action. Unles paramters `page` or `per-page` are mentioned among action method argument they do not appear at canonical URL."}}
{"actor":{"display_login":"klimov-paul"}}