Hey all

I'd like to add a behavior to the AppModel on the fly from within a
component. Normally you do...

$this->Controller->MyModel->Behaviors->attach('MyBehavior');

...but sadly for AppModel this doesn't work:

$this->Controller->AppModel->Behaviors->attach('MyBehavior');

...results in:

Fatal error: Call to a member function attach() on a non-object

But I guess there IS a way to do that, isn't there? :-)

Thanks for help,
Josh

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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