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:
nate 2006-08-25 17:38:53 +00:00
parent feb526a9ba
commit 6156bae011

View file

@ -112,7 +112,7 @@ class Dispatcher extends Object {
}
}
if(isset($params['plugin'])){
if(isset($params['plugin'])) {
$plugin = $params['plugin'];
$pluginName = Inflector::camelize($params['action']);
$pluginClass = $pluginName.'Controller';
@ -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);