views:

31

answers:

1

I've added the following to my application.ini:

[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
autoloadernamespaces[] = "DP_"

This way, within my controller, I can say new DP_Form_Login(), and it will load the form class from library/DP/Form/Login.php. Is there a way then, to make it so that my controller class (which I've now called DP_Controller_Login, and placed in to library/DP/Controller/Login.php will be called when I access /login?

+2  A: 

well really you want all your controllers in the controllerDirectory... Likewise you might want to move to APPLICATION_PATH /forms as thats the standard place. library is typically for things that are more general - think of it as your framework on top of Zend Framework, while the stuff in application and application/modules/$modulename is application/module specific.

Obviously ZF is flexible enough that you can set your structure up any way you please, but if you go outside the "standard" youre going to have to write a lot of uneeded configuration if not code... Its just easier to play inside the box unless you have a really compelling reason to work outside of it.

prodigitalson

related questions