mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
Updated the default Cake routes to include a defaultRoute true flag to allow differentiation
Merge #3579 from davidyell/routing-markers onto 2.6 Fixes #3535
This commit is contained in:
parent
2546b79c62
commit
1e3730c988
1 changed files with 7 additions and 6 deletions
|
@ -48,8 +48,8 @@ if ($plugins = CakePlugin::loaded()) {
|
|||
$plugins[$key] = Inflector::underscore($value);
|
||||
}
|
||||
$pluginPattern = implode('|', $plugins);
|
||||
$match = array('plugin' => $pluginPattern);
|
||||
$shortParams = array('routeClass' => 'PluginShortRoute', 'plugin' => $pluginPattern);
|
||||
$match = array('plugin' => $pluginPattern, 'defaultRoute' => true);
|
||||
$shortParams = array('routeClass' => 'PluginShortRoute', 'plugin' => $pluginPattern, 'defaultRoute' => true);
|
||||
|
||||
foreach ($prefixes as $prefix) {
|
||||
$params = array('prefix' => $prefix, $prefix => true);
|
||||
|
@ -66,11 +66,11 @@ if ($plugins = CakePlugin::loaded()) {
|
|||
foreach ($prefixes as $prefix) {
|
||||
$params = array('prefix' => $prefix, $prefix => true);
|
||||
$indexParams = $params + array('action' => 'index');
|
||||
Router::connect("/{$prefix}/:controller", $indexParams);
|
||||
Router::connect("/{$prefix}/:controller/:action/*", $params);
|
||||
Router::connect("/{$prefix}/:controller", $indexParams, array('defaultRoute' => true));
|
||||
Router::connect("/{$prefix}/:controller/:action/*", $params, array('defaultRoute' => true));
|
||||
}
|
||||
Router::connect('/:controller', array('action' => 'index'));
|
||||
Router::connect('/:controller/:action/*');
|
||||
Router::connect('/:controller', array('action' => 'index'), array('defaultRoute' => true));
|
||||
Router::connect('/:controller/:action/*', array(), array('defaultRoute' => true));
|
||||
|
||||
$namedConfig = Router::namedConfig();
|
||||
if ($namedConfig['rules'] === false) {
|
||||
|
@ -79,3 +79,4 @@ if ($namedConfig['rules'] === false) {
|
|||
|
||||
unset($namedConfig, $params, $indexParams, $prefix, $prefixes, $shortParams, $match,
|
||||
$pluginPattern, $plugins, $key, $value);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue