also load Components of parent classes

This commit is contained in:
coderkun 2014-08-09 00:36:17 +02:00
parent 200b1fe937
commit 6a5f3739cc

View file

@ -165,10 +165,6 @@
// Response speichern // Response speichern
$this->response = $response; $this->response = $response;
// Linker erstellen
$this->set('linker', new \nre\core\Linker($request));
} }
@ -325,6 +321,15 @@
if(!is_array($components)) { if(!is_array($components)) {
$components = array($components); $components = array($components);
} }
// Components of parent classes
$parent = $this;
while($parent = get_parent_class($parent))
{
$properties = get_class_vars($parent);
if(array_key_exists('components', $properties)) {
$components = array_merge($components, $properties['components']);
}
}
// Load components // Load components
foreach($components as &$component) foreach($components as &$component)