Author: phpnut
Date: 12:05:28 AM, Saturday, October 29, 2005
Message:
Fixed issue with components not creating an instance of their components




git-svn-id: https://svn.cakephp.org/repo/trunk/cake@1265 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2005-10-29 05:11:20 +00:00
parent 3985213812
commit 30adcf8d0a
2 changed files with 19 additions and 5 deletions

View file

@ -6,4 +6,4 @@
// +---------------------------------------------------------------------------------------------------+ //
///////////////////////////////////////////////////////////////////////////////////////////////////////////
0.10.2.1263_alpha
0.10.2.1265_alpha

View file

@ -66,8 +66,22 @@ class Component extends Object
function Component(&$controller)
{
$this->controller =& $controller;
$loaded = array();
return $this->_loadComponents($loaded,$this->controller->components);
if ($this->controller->components !== false)
{
$loaded = array();
$loaded = $this->_loadComponents($loaded,$this->controller->components);
foreach(array_keys($loaded) as $component)
{
$tempComponent =& $loaded[$component];
if(isset($tempComponent->components) && is_array($tempComponent->components))
{
foreach($tempComponent->components as $subComponent)
{
$this->controller->{$component}->{$subComponent} =& $loaded[$subComponent];
}
}
}
}
}
/**
@ -111,7 +125,7 @@ class Component extends Object
}
else
{
$error =& new AppController();
$error =& new Controller();
$error->autoLayout = true;
$error->base = $this->controller->base;
call_user_func_array(array(&$error, 'missingComponentClass'), $component);
@ -120,7 +134,7 @@ class Component extends Object
}
else
{
$error =& new AppController();
$error =& new Controller();
$error->autoLayout = true;
$error->base = $this->controller->base;
call_user_func_array(array(&$error, 'missingComponentFile'), Inflector::underscore($component));