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:
An improvement to unbindModel on model side
December 14, 2006 @ 07:56:00

The Bakery has a new CakePHP tip posted today showing how to improve the unbindModel handling on the model side of things (versus in the controller as mentioned previously).

The problem with that solution is that it requires you to change the way you define your model relations. [...] Rather try to change your code to suit your needs, and let CakePHP do what it does best: act as a framework.

The technique approaches the associations differently - loaded and called when you make the call to expects() versus just automatically. They include the code to make it all work for an extension to the Model (AppModel), and extension to the AppModel (Title), and finally the TitlesController that shows the deliberate calls to expects to pull in the models.

0 comments voice your opinion now!
improvement unbindmodel model controller expect load improvement unbindmodel model controller expect load


blog comments powered by Disqus

Similar Posts

The Bakery: An improvement to unbindModel on model side

Reddit.com: Dependency injection in ZF2 and Symfony 2 are service locators

CodeSnipers.com: Stupidly Easy MVC - Group Membership Application (Part 2)

Padraic Brady's Blog: The M in MVC: Why Models are Misunderstood and Unappreciated

Raphael Stolt's Blog: Creating Zend Framework snippets for TextMate


Community Events





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


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

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