CakePHP Cookbook Documentation 5.xkeep your routing code DRY, the Router has the concept of ‘scopes’. A scope defines a common path segment, and optionally route defaults. Any routes connected inside a scope will inherit the path/defaults the default routes, this would also connect a route for /articles/delete- all. By default the path segment will match the key name. You can use the ‘path’ key inside the resource definition to customize the default resource routes use an inflected form of the resource name for the URL segment. You can set a custom URL segment with the path option: $routes->scope('/', function (RouteBuilder $routes) {0 码力 | 1080 页 | 939.39 KB | 1 年前3
CakePHP Cookbook Documentation 5.xkeep your routing code DRY, the Router has the concept of ‘scopes’. A scope defines a common path segment, and optionally route defaults. Any routes connected inside a scope will inherit the path/defaults the default routes, this would also connect a route for /articles/delete-all. By default the path segment will match the key name. You can use the ‘path’ key inside the resource definition to customize the default resource routes use an inflected form of the resource name for the URL segment. You can set a custom URL segment with the path option: $routes->scope('/', function (RouteBuilder $routes) { $0 码力 | 848 页 | 2.53 MB | 1 年前3
CakePHP Cookbook 3.x
keep your routing code DRY, the Router has the concept of ‘scopes’. A scope defines a common path segment, and optionally route defaults. Any routes connected inside a scope will inherit the path/defaults the default routes, this would also connect a route for /articles/delete_all. By default the path segment will match the key name. You can use the ‘path’ key inside the resource definition to customize the default resource routes use an inflected form of the resource name for the URL segment. You can set a custom URL segment with the path option: Router::scope('/', function (RouteBuilder $routes) {0 码力 | 1244 页 | 1.05 MB | 1 年前3
CakePHP Cookbook 3.x
keep your routing code DRY, the Router has the concept of ‘scopes’. A scope defines a common path segment, and optionally route defaults. Any routes connected inside a scope will inherit the path/defaults the default routes, this would also connect a route for /articles/delete_all. By default the path segment will match the key name. You can use the ‘path’ key inside the resource definition to customize the default resource routes use an inflected form of the resource name for the URL segment. You can set a custom URL segment with the path option: Router::scope('/', function (RouteBuilder $routes) { $r0 码力 | 967 页 | 2.80 MB | 1 年前3
CakePHP Cookbook 4.x
keep your routing code DRY, the Router has the concept of ‘scopes’. A scope defines a common path segment, and optionally route defaults. Any routes connected inside a scope will inherit the path/defaults the default routes, this would also connect a route for /articles/delete- all. By default the path segment will match the key name. You can use the ‘path’ key inside the resource definition to customize the default resource routes use an inflected form of the resource name for the URL segment. You can set a custom URL segment with the path option: $routes->scope('/', function (RouteBuilder $routes) {0 码力 | 1249 页 | 1.04 MB | 1 年前3
CakePHP Cookbook 4.x
keep your routing code DRY, the Router has the concept of ‘scopes’. A scope defines a common path segment, and optionally route defaults. Any routes connected inside a scope will inherit the path/defaults the default routes, this would also connect a route for /articles/delete-all. By default the path segment will match the key name. You can use the ‘path’ key inside the resource definition to customize the default resource routes use an inflected form of the resource name for the URL segment. You can set a custom URL segment with the path option: $routes->scope('/', function (RouteBuilder $routes) { $0 码力 | 967 页 | 2.88 MB | 1 年前3
CakePHP Cookbook 2.x
_serialize the XmlView will wrap your serialized view variables with anode. You can set a custom name for this node using the _rootNode view variable. New in version 2.3: The _rootNode feature array('User' => array( 'username' => 'super@example.com' )); Given the previous array structure, the node would be accessed by User.username, with the dot indicating the nested array. This notation is used extends AppModel { public $actsAs = array('Tree' => array( 'left' => 'left_node', 'right' => 'right_node' )); } We can also attach several behaviors to a model. There’s no reason why 0 码力 | 1096 页 | 958.62 KB | 1 年前3
CakePHP Cookbook 2.x
_serialize the XmlView will wrap your serialized view variables with anode. You can set a custom name for this node using the _rootNode view variable. New in version 2.3: The _rootNode feature array('User' => array( 'username' => 'super@example.com' )); Given the previous array structure, the node would be accessed by User.username, with the dot indicating the nested array. This notation is used you want to set an ACO or ARO node as the parent for your Model, parentNode() must return the alias of the ACO or ARO node: public function parentNode() { return 'root_node'; } A more complete example 0 码力 | 820 页 | 2.52 MB | 1 年前3
共 8 条
- 1













