{"action":"created","issue":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/8635","labels_url":"https://api.github.com/repos/yiisoft/yii2/issues/8635/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/8635/comments","events_url":"https://api.github.com/repos/yiisoft/yii2/issues/8635/events","html_url":"https://github.com/yiisoft/yii2/issues/8635","id":83965649,"number":8635,"title":"Add support for verbs to create url.","user":{"login":"SamMousa","id":547021,"avatar_url":"https://avatars.githubusercontent.com/u/547021?v=3","gravatar_id":"","url":"https://api.github.com/users/SamMousa","html_url":"https://github.com/SamMousa","followers_url":"https://api.github.com/users/SamMousa/followers","following_url":"https://api.github.com/users/SamMousa/following{/other_user}","gists_url":"https://api.github.com/users/SamMousa/gists{/gist_id}","starred_url":"https://api.github.com/users/SamMousa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SamMousa/subscriptions","organizations_url":"https://api.github.com/users/SamMousa/orgs","repos_url":"https://api.github.com/users/SamMousa/repos","events_url":"https://api.github.com/users/SamMousa/events{/privacy}","received_events_url":"https://api.github.com/users/SamMousa/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-06-02T10:47:15Z","updated_at":"2015-06-02T11:55:26Z","closed_at":null,"body":"Currently when creating URLs via the Url helper or UrlManager, the intended verb is not used.\r\n\r\nIt should be possible to add an optional parameter to the URL creation routines. This would then be passed on to CUrlRule::createUrl, which will return false if the rule does not apply to the passed VERB.\r\n\r\nSuppose you have URL rules that do this:\r\nput to /cars/18  ---> CarsController::actionUpdate(18);\r\nget to /cars/18 ---> CarsController::actionRead(18)\r\n\r\nNow for some page I need to make a put request to the read action; this is impossible using the url generator functions.\r\n\r\nUrl::to(['cars/read', 'id' => 18) will create /cars/18, which will resolve to update if i do a put request.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/comments/107927358","html_url":"https://github.com/yiisoft/yii2/issues/8635#issuecomment-107927358","issue_url":"https://api.github.com/repos/yiisoft/yii2/issues/8635","id":107927358,"user":{"login":"samdark","id":47294,"avatar_url":"https://avatars.githubusercontent.com/u/47294?v=3","gravatar_id":"","url":"https://api.github.com/users/samdark","html_url":"https://github.com/samdark","followers_url":"https://api.github.com/users/samdark/followers","following_url":"https://api.github.com/users/samdark/following{/other_user}","gists_url":"https://api.github.com/users/samdark/gists{/gist_id}","starred_url":"https://api.github.com/users/samdark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samdark/subscriptions","organizations_url":"https://api.github.com/users/samdark/orgs","repos_url":"https://api.github.com/users/samdark/repos","events_url":"https://api.github.com/users/samdark/events{/privacy}","received_events_url":"https://api.github.com/users/samdark/received_events","type":"User","site_admin":false},"created_at":"2015-06-02T11:55:26Z","updated_at":"2015-06-02T11:55:26Z","body":"Overall I agree with @klimov-paul. In general, same endpoint should use same URL no matter what verb is."}}