News Feed
Jobs Feed
Sections




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

PHPMag.ru:
Zend Framework models auto-loading
April 03, 2009 @ 10:25:44

From the PHPMag.ru site comes a recent post looking at a technique for creating auto-loading models in your Zend Framework application.

When it comes to MVC, ZF handles almost everything - your action controllers are triggered, your views are loaded, w/o you having to worry about them. Not the same with models. If you comply to directory layout advised by ZF, you have "models" folder, but framework doesn't interact with it in any way.

There's a three step process he includes to make your models autoload - extend the Zend_Controller_action for the controller you're working with, put loadModel() method into the controller (what will actually load the models) and an optional third step of adding in class autoloading. A few alternatives are also mentioned: Zend_Load_PluginLoader, Zend_Load subclassing and a controller plugin.

1 comment voice your opinion now!
model autoload zendframework tutorial loadmodel plugin option


blog comments powered by Disqus

Similar Posts

Rob Morgan's Blog: Howto Log Directly to Your OS X Terminal using Zend Framework and NodeJS

Michael Nitschinger's Blog: Introducing Relationships in Lithium

Ryan Mauger's Blog: Keeping your html valid with Zend Framework, Tidy and Firebug

php|architect: More powerful Validation from Respect

Elliot Haughin's Blog: Building UTF8 Compatible CodeIgniter Applications


Community Events











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


database framework introduction release example project component security hhvm hack performance unittest install composer language package symfony2 facebook podcast application

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