Adding fix for failing routes for plugins

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5475 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2007-07-31 05:00:24 +00:00
parent 504dec6d76
commit 64325bd60d
2 changed files with 9 additions and 1 deletions

View file

@ -765,6 +765,14 @@ class Router extends Object {
} elseif (!isset($params['pass'])) {
$params['pass'] = '';
}
if (isset($params['plugin'])) {
if(strpos($route[0], 'plugin') === false && !empty($route[2])) {
$route[2] = array_merge($route[2], array('plugin'));
$route[0] = '/:plugin' . $route[0];
}
}
if (strpos($route[0], '*')) {
$out = str_replace('*', $params['pass'], $route[0]);
} else {

View file

@ -27,7 +27,7 @@
* @license http://www.opensource.org/licenses/opengroup.php The Open Group Test Suite License
*/
require_once CAKE.'app_helper.php';
uses('class_registry', 'controller'.DS.'controller', 'model'.DS.'model', 'view'.DS.'helper',
uses('class_registry', 'controller'.DS.'controller', 'model'.DS.'model', 'view'.DS.'helper',
'view'.DS.'helpers'.DS.'html', 'view'.DS.'helpers'.DS.'form');
class TheHtmlTestController extends Controller {