mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-06 03:22:39 +00:00
Merge branch 'master' into 2.5
Conflicts: lib/Cake/Model/Permission.php
This commit is contained in:
commit
9de3418079
25 changed files with 218 additions and 31 deletions
|
@ -85,14 +85,45 @@ class Router {
|
|||
protected static $_validExtensions = array();
|
||||
|
||||
/**
|
||||
* 'Constant' regular expression definitions for named route elements
|
||||
* Regular expression for action names
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const ACTION = 'index|show|add|create|edit|update|remove|del|delete|view|item';
|
||||
|
||||
/**
|
||||
* Regular expression for years
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const YEAR = '[12][0-9]{3}';
|
||||
|
||||
/**
|
||||
* Regular expression for months
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const MONTH = '0[1-9]|1[012]';
|
||||
|
||||
/**
|
||||
* Regular expression for days
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const DAY = '0[1-9]|[12][0-9]|3[01]';
|
||||
|
||||
/**
|
||||
* Regular expression for auto increment IDs
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const ID = '[0-9]+';
|
||||
|
||||
/**
|
||||
* Regular expression for UUIDs
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const UUID = '[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}';
|
||||
|
||||
/**
|
||||
|
@ -245,19 +276,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 +301,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 +338,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…
Add table
Add a link
Reference in a new issue