From 8015643b1df5e34c507a2b65ad5863039379f3d4 Mon Sep 17 00:00:00 2001 From: coderkun Date: Sat, 9 Aug 2014 00:36:17 +0200 Subject: [PATCH] also load Components of parent classes --- core/Controller.inc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/core/Controller.inc b/core/Controller.inc index c2814e99..47b5e0a5 100644 --- a/core/Controller.inc +++ b/core/Controller.inc @@ -165,10 +165,6 @@ // Response speichern $this->response = $response; - - // Linker erstellen - $this->set('linker', new \nre\core\Linker($request)); - } @@ -325,6 +321,15 @@ if(!is_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 foreach($components as &$component)