From 6156bae011d76932b846d29bb52906f6430885a8 Mon Sep 17 00:00:00 2001 From: nate Date: Fri, 25 Aug 2006 17:38:53 +0000 Subject: [PATCH] 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 --- cake/dispatcher.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/cake/dispatcher.php b/cake/dispatcher.php index 1fc9e2aad..e71be6228 100644 --- a/cake/dispatcher.php +++ b/cake/dispatcher.php @@ -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);