mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
[1264]
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:
parent
3985213812
commit
30adcf8d0a
2 changed files with 19 additions and 5 deletions
|
@ -6,4 +6,4 @@
|
|||
// +---------------------------------------------------------------------------------------------------+ //
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
0.10.2.1263_alpha
|
||||
0.10.2.1265_alpha
|
|
@ -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));
|
||||
|
|
Loading…
Reference in a new issue