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

Federico Cargnelutti's Blog:
An Alternative to Zend_Controller: The Model
Apr 14, 2009 @ 13:48:46

Federico Cargnelutti has posted the third part of his series looking at his alternative to the normal Zend_Controller in Zend Framework applications - Zf_Controller. This article focuses on its interface with the model.

The domain layer is separated from the other layers and has no dependencies on Zf_Controller. Adding the domain directory to your include path allows you to load and access Model classes from anywhere within your project.

His code examples show an IndexController extending the Zf_Controller and how a Model can be called from inside it through a getInstance (as long as the model directory is in your path). You can take a look at part one and part two for more information on this alternative component.

tagged: zfcontroller zendcontroller model interface getinstance includepath

Link:

Jacob Santos' Blog:
Zend Framework: Hackish Include Path Solution
Oct 02, 2006 @ 18:18:50

Jacob Santos was having a problem with the Zend Framework. It couldn't find its own files. So, he's come up with a hack that helps mod_php users to avoid the problem.

I've had problem with Zend Framework not being able to find its files, which is usually not good. The "workaround" of adding the realpath works, but would be overwritten when updating. Besides, going through the files just to add realpath locations is a hassle.

The php_value only works with mod_php, so good luck if you are running PHP using CGI/FastCGI. Actually, you'll have no luck, because it won't work using CGI.

Essentially, it uses the ihi_set function to define the correct include path. Check out the comments of the post for some other suggestions.

tagged: zend framework path solution hack iniset includepath zend framework path solution hack iniset includepath

Link:

Jacob Santos' Blog:
Zend Framework: Hackish Include Path Solution
Oct 02, 2006 @ 18:18:50

Jacob Santos was having a problem with the Zend Framework. It couldn't find its own files. So, he's come up with a hack that helps mod_php users to avoid the problem.

I've had problem with Zend Framework not being able to find its files, which is usually not good. The "workaround" of adding the realpath works, but would be overwritten when updating. Besides, going through the files just to add realpath locations is a hassle.

The php_value only works with mod_php, so good luck if you are running PHP using CGI/FastCGI. Actually, you'll have no luck, because it won't work using CGI.

Essentially, it uses the ihi_set function to define the correct include path. Check out the comments of the post for some other suggestions.

tagged: zend framework path solution hack iniset includepath zend framework path solution hack iniset includepath

Link:


Trending Topics: