Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated routes.php so routes default routes only take the route param…

…eter patterns they need.
  • Loading branch information...
commit 37fd8dcc5527a900a40af4a0d0e23bda140908cd 1 parent a554ac4
@sam-at-github sam-at-github authored
Showing with 6 additions and 4 deletions.
  1. +6 −4 src/Config/routes.php
View
10 src/Config/routes.php
@@ -51,23 +51,25 @@
}
$pluginPattern = implode('|', $plugins);
$indexParams = ['action' => 'index'];
-$match = ['prefix' => $prefixPattern, 'plugin' => $pluginPattern];
-$pluginShortMatch = $match + [
+$pluginShortMatch = [
'routeClass' => 'Cake\Routing\Route\PluginShortRoute',
'_name' => '_plugin._controller:index'
];
if ($prefixPattern && $pluginPattern) {
- Router::connect('/:prefix/:plugin', $indexParams, $pluginShortMatch);
+ $match = ['prefix' => $prefixPattern, 'plugin' => $pluginPattern];
+ Router::connect('/:prefix/:plugin', $indexParams, $match + $pluginShortMatch);
Router::connect('/:prefix/:plugin/:controller', $indexParams, $match);
Router::connect('/:prefix/:plugin/:controller/:action/*', [], $match);
}
if ($pluginPattern) {
- Router::connect('/:plugin', $indexParams, $pluginShortMatch);
+ $match = ['plugin' => $pluginPattern];
+ Router::connect('/:plugin', $indexParams, $match + $pluginShortMatch);
Router::connect('/:plugin/:controller', $indexParams, $match);
Router::connect('/:plugin/:controller/:action/*', [], $match);
}
if ($prefixPattern) {
+ $match = ['prefix' => $prefixPattern];
Router::connect('/:prefix/:controller', $indexParams, $match);
Router::connect('/:prefix/:controller/:action/*', [], $match);
}
Please sign in to comment.
Something went wrong with that request. Please try again.