mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Merge pull request #2786 from sam-at-github/master
Router::comment() documentation
This commit is contained in:
commit
96048f401a
1 changed files with 7 additions and 3 deletions
|
@ -245,19 +245,19 @@ class Router {
|
|||
* Connects a new Route in the router.
|
||||
*
|
||||
* Routes are a way of connecting request URLs to objects in your application. At their core routes
|
||||
* are a set or regular expressions that are used to match requests to destinations.
|
||||
* are a set of regular expressions that are used to match requests to destinations.
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
* `Router::connect('/:controller/:action/*');`
|
||||
*
|
||||
* The first parameter will be used as a controller name while the second is used as the action name.
|
||||
* The first token ':controller' will be used as a controller name while the second is used as the action name.
|
||||
* the '/*' syntax makes this route greedy in that it will match requests like `/posts/index` as well as requests
|
||||
* like `/posts/edit/1/foo/bar`.
|
||||
*
|
||||
* `Router::connect('/home-page', array('controller' => 'pages', 'action' => 'display', 'home'));`
|
||||
*
|
||||
* The above shows the use of route parameter defaults. And providing routing parameters for a static route.
|
||||
* The above shows the use of route parameter defaults, and providing routing parameters for a static route.
|
||||
*
|
||||
* {{{
|
||||
* Router::connect(
|
||||
|
@ -270,6 +270,9 @@ class Router {
|
|||
* Shows connecting a route with custom route parameters as well as providing patterns for those parameters.
|
||||
* Patterns for routing parameters do not need capturing groups, as one will be added for each route params.
|
||||
*
|
||||
* $defaults is merged with the results of parsing the request URL to form the final routing destination and its
|
||||
* parameters. This destination is expressed as an associative array by Router. See the output of {@link parse()}.
|
||||
*
|
||||
* $options offers four 'special' keys. `pass`, `named`, `persist` and `routeClass`
|
||||
* have special meaning in the $options array.
|
||||
*
|
||||
|
@ -304,6 +307,7 @@ class Router {
|
|||
* shifted into the passed arguments, supplying patterns for routing parameters and supplying the name of a
|
||||
* custom routing class.
|
||||
* @see routes
|
||||
* @see parse().
|
||||
* @return array Array of routes
|
||||
* @throws RouterException
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue