07.30
php
saved
Jonah
Note
Jonah did not leave a note
Jonah did not leave a note
- <?php
- //loads a component on the fly from within the controller
- class ComponentLoaderComponent extends Object {
- var $controller = null;
- function initialize(&$controller) {
- // saving the controller reference for later use
- $this->controller =& $controller;
- }
- function load($component_name) {
- App::import('Component', $component_name);
- $component2 = $component_name.'Component';
- $component =& new $component2(null);
- $component->initialize($this->controller);
- $component->startup($this->controller);
- $this->controller->{$component_name} = &$component;
- }
- }
- ?>
Parsed in 0.034 seconds, using GeSHi 1.0.7.14