mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Adding Router param setting enhancements from a *long* time ago
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3431 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
feb526a9ba
commit
6156bae011
1 changed files with 17 additions and 1 deletions
|
@ -232,6 +232,22 @@ class Dispatcher extends Object {
|
|||
|
||||
$controller->webservices = $params['webservices'];
|
||||
$controller->plugin = $this->plugin;
|
||||
if (isset($params['viewPath'])) {
|
||||
$controller->viewPath = $params['viewPath'];
|
||||
}
|
||||
if (isset($params['layout'])) {
|
||||
if ($params['layout'] === '') {
|
||||
$controller->autoLayout = false;
|
||||
} else {
|
||||
$controller->layout = $params['layout'];
|
||||
}
|
||||
}
|
||||
foreach(array('components', 'helpers') as $var) {
|
||||
if (isset($params[$var]) && !empty($params[$var]) && is_array($controller->{$var})) {
|
||||
$diff = array_diff($params[$var], $controller->{$var});
|
||||
$controller->{$var} = array_merge($controller->{$var}, $diff);
|
||||
}
|
||||
}
|
||||
|
||||
if(!is_null($controller->webservices)) {
|
||||
array_push($controller->components, $controller->webservices);
|
||||
|
|
Loading…
Reference in a new issue