I don't know simple way to do it. Only manual one:

function attachComponent($component, $settings = array ()) {
        if (!isset($this->{$component})) {
                $this->components[] = $component;
                $this->Component->_loadComponents($this);
                if (isset($this->{$component})) {
                        if (method_exists($this->{$component}, 'initialize')) {
                                $this->{$component}->initialize($this, 
$settings);
                        }
                        if (method_exists($this->{$component}, 'startup')) {
                                $this->{$component}->startup($this);
                        }
                }
        }
}

On May 20, 2:11 am, Dérico Filho <[email protected]> wrote:
> Is it possible to attach a component to a controller on the fly?
>
> Like this, perhaps:
>
> function nameOfAction(){
> $this->attachComponent('RequestHandler');
>
> }
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to