mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-17 14:57:23 +08:00
doc enhancements for #461
This commit is contained in:
@@ -43,15 +43,18 @@ class UrlManager extends Component
|
|||||||
* array, one can use the key to represent the pattern and the value the corresponding route.
|
* array, one can use the key to represent the pattern and the value the corresponding route.
|
||||||
* For example, `'post/<id:\d+>' => 'post/view'`.
|
* For example, `'post/<id:\d+>' => 'post/view'`.
|
||||||
*
|
*
|
||||||
* For RESTful routing this shortcut also allows you to specify the [[UrlRule::verb|HTTP verb]]
|
* For RESTful routing the mentioned shortcut format also allows you to specify the
|
||||||
* the rule should apply for by prepending it to the pattern, separated by a blank.
|
* [[UrlRule::verb|HTTP verb]] that the rule should apply for.
|
||||||
|
* You can do that by prepending it to the pattern, separated by a space.
|
||||||
* For example, `'PUT post/<id:\d+>' => 'post/update'`.
|
* For example, `'PUT post/<id:\d+>' => 'post/update'`.
|
||||||
* You may specify multiple verbs by separating them with comma
|
* You may specify multiple verbs by separating them with comma
|
||||||
* like this: `'POST,PUT post/index' => 'post/create'`.
|
* like this: `'POST,PUT post/index' => 'post/create'`.
|
||||||
|
* The supported verbs in the shortcut format are: GET, POST, PUT and DELETE.
|
||||||
* Note that [[UrlRule::mode|mode]] will be set to PARSING_ONLY when specifying verb in this way
|
* Note that [[UrlRule::mode|mode]] will be set to PARSING_ONLY when specifying verb in this way
|
||||||
* so you normally would not specify a verb for normal GET request.
|
* so you normally would not specify a verb for normal GET request.
|
||||||
*
|
*
|
||||||
* Here is an example configuration for RESTful CRUD controller:
|
* Here is an example configuration for RESTful CRUD controller:
|
||||||
|
*
|
||||||
* ~~~php
|
* ~~~php
|
||||||
* array(
|
* array(
|
||||||
* 'dashboard' => 'site/index',
|
* 'dashboard' => 'site/index',
|
||||||
|
|||||||
Reference in New Issue
Block a user