News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Sanisoft.com:
Attach & detach behaviors at run-time in CakePHP Models
June 26, 2007 @ 12:38:00

The guys over on Sanisoft.com dropped us a line today to let us know about a new entry on their blog showing how to implement attach and detach behaviors in CakePHP models.

Behaviors are one of the best things that have been added to CakePHP 1.2, they allow you to add functionality to your models in a very elegant and modular fashion. They also promote a lot of code reuse. Perhaps a real life example would illustrate it better.

They show how to create behaviors that can perform a save() call on an image with the backend code doing all the hard work. They create the two methods - dontActAs and nowActsAs - to make attaching and detaching simple.

0 comments voice your opinion now!
cakephp framework attach detach behavior model cakephp framework attach detach behavior model


blog comments powered by Disqus

Similar Posts

Community News: Symfony-Check.org (A Symfony Deployment Checklist)

SaniSoft Blog: Help! vendor() is deprecated.

Community News: Drual 5.0 Released (on it's 6th Birthday!)

php|architect Blog: To use a framework, or not to: that is the question

Synfony Project: New testing framework


Community Events





Don't see your event here?
Let us know!


series api testing opinion interview symfony2 community refactor developer list introduction threedevsandamaybe framework laravel install unittest release code language podcast

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework