mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
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
This commit is contained in:
parent
90567a286a
commit
e65c404c9c
1 changed files with 10 additions and 5 deletions
|
@ -193,7 +193,7 @@ class Dispatcher extends Object {
|
||||||
$controller->action = $this->params['action'];
|
$controller->action = $this->params['action'];
|
||||||
$controller->webservices = $this->params['webservices'];
|
$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->passedArgs = $passedArgs;
|
||||||
$controller->namedArgs = $namedArgs;
|
$controller->namedArgs = $namedArgs;
|
||||||
|
|
||||||
|
@ -495,14 +495,19 @@ class Dispatcher extends Object {
|
||||||
if (!empty($params['plugin'])) {
|
if (!empty($params['plugin'])) {
|
||||||
$this->plugin = $params['plugin'];
|
$this->plugin = $params['plugin'];
|
||||||
$pluginPath = Inflector::camelize($this->plugin).'.';
|
$pluginPath = Inflector::camelize($this->plugin).'.';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($pluginPath . $controller && loadController($pluginPath . $controller)) {
|
if ($pluginPath . $controller && loadController($pluginPath . $controller)) {
|
||||||
if(!class_exists(low($ctrlClass)) && $this->plugin) {
|
if(!class_exists(low($ctrlClass)) && $this->plugin) {
|
||||||
$controller = Inflector::camelize($params['plugin']);
|
$ctrlClass = Inflector::camelize($params['plugin']) . 'Controller';
|
||||||
$ctrlClass = $controller.'Controller';
|
$pass = $params['action'];
|
||||||
$params = am($this->params, array('plugin'=> $params['plugin'], 'controller'=> $params['plugin']));
|
|
||||||
|
$params = am($params, array(
|
||||||
|
'plugin' => $params['plugin'],
|
||||||
|
'controller' => $params['plugin'],
|
||||||
|
'action' => $params['controller'],
|
||||||
|
));
|
||||||
|
array_unshift($params['pass'], $pass);
|
||||||
}
|
}
|
||||||
if(class_exists(low($ctrlClass))) {
|
if(class_exists(low($ctrlClass))) {
|
||||||
$controller =& new $ctrlClass();
|
$controller =& new $ctrlClass();
|
||||||
|
|
Loading…
Add table
Reference in a new issue