News Feed
Sections




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

The Bakery:
Keeping bindModel and unbindModel out of your Controllers
December 08, 2006 @ 13:53:15

On the Bakery (the CakePHP site), there's a new entry talking about how to keep bindModel and unbindModel (create/destroy associations) out of your Controller and banishing them back to where they belong.

Here I show you how to add a simple method to your Model classes that allows your controllers to specify binds directly, in a cleaner, more proper way.

They start with a simple modification to the AppModel class before implementing the associations in another class, Title, extending the new and improved AppModel. They follow with with a clean, bindModel-free Controller that sets values and reads from the associated model data.

0 comments voice your opinion now!
cakephp framework bindmodel unbindmodel model controller cakephp framework bindmodel unbindmodel model controller


blog comments powered by Disqus

Similar Posts

Chris Hartjes' Blog: Tutorial: Integrating PHP/SWF Charts with CakePHP

Felix Geisendörfer's Blog: Learning from the CakePHP Source Code (Part 1)

Shahar Evron's Blog: Adapters of the new Zend_Http_Client

Shahar Evron's Blog: Adapters of the new Zend_Http_Client

Tim Koschuetzki's Blog: How To Transform HTML To Textile Markup - The CakePHP TextileHelper Revisite


Community Events





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


version conference security artisanfiles library list voicesoftheelephpant interview tool community opinion framework laravel symfony introduction podcast release language series composer

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