From e65c404c9ccd03a59c41c17e81a6577c7dfe5913 Mon Sep 17 00:00:00 2001 From: nate Date: Thu, 16 Aug 2007 16:32:18 +0000 Subject: [PATCH] Moving named argument handling into Router git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5536 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/dispatcher.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/cake/dispatcher.php b/cake/dispatcher.php index c2509fcd7..70f21ae6e 100644 --- a/cake/dispatcher.php +++ b/cake/dispatcher.php @@ -193,7 +193,7 @@ class Dispatcher extends Object { $controller->action = $this->params['action']; $controller->webservices = $this->params['webservices']; - list($passedArgs, $namedArgs) = Router::getArgs($this->params, $controller->namedArgs, $controller->argSeparator); + list($passedArgs, $namedArgs) = Router::getArgs($this->params); $controller->passedArgs = $passedArgs; $controller->namedArgs = $namedArgs; @@ -495,14 +495,19 @@ class Dispatcher extends Object { if (!empty($params['plugin'])) { $this->plugin = $params['plugin']; $pluginPath = Inflector::camelize($this->plugin).'.'; - } if ($pluginPath . $controller && loadController($pluginPath . $controller)) { if(!class_exists(low($ctrlClass)) && $this->plugin) { - $controller = Inflector::camelize($params['plugin']); - $ctrlClass = $controller.'Controller'; - $params = am($this->params, array('plugin'=> $params['plugin'], 'controller'=> $params['plugin'])); + $ctrlClass = Inflector::camelize($params['plugin']) . 'Controller'; + $pass = $params['action']; + + $params = am($params, array( + 'plugin' => $params['plugin'], + 'controller' => $params['plugin'], + 'action' => $params['controller'], + )); + array_unshift($params['pass'], $pass); } if(class_exists(low($ctrlClass))) { $controller =& new $ctrlClass();