From 5dea05942971b2e61c83b38ce499af8e95d8d4cb Mon Sep 17 00:00:00 2001 From: coderkun Date: Sat, 5 Apr 2014 13:28:46 +0200 Subject: [PATCH] load Controller Components of parent classes --- core/Controller.inc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/Controller.inc b/core/Controller.inc index c2814e99..941e7523 100644 --- a/core/Controller.inc +++ b/core/Controller.inc @@ -325,6 +325,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)