Jiew Meng
Jiew Meng

Reputation: 88197

Zend Framework 1.1 Modules setup

i used zend_tool to setup a project then to create module blog with index controller etc but i guess the default config setup by zend_tool does not work with modules so i edited it

resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.frontController.moduleDirectoryControllerName = "controllers"

i guess these are required for modules? also i moved the folders, controllers, models, views into the modules/ folder

but i get a blank screen when i try to go to http://servername which shld load Default module's index controller and action. even if i try to go http://servername/nonexistentpage it also shows a blank screen instead of a 404

Upvotes: 2

Views: 4746

Answers (1)

takeshin
takeshin

Reputation: 50638

You don't have to move controllers, models, and views. These are directories of the default module, which is not placed in modules directory (by default).

All you need is:

resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.modules[] =

If you want to place default module in the modules too, you have to set up the app like this:

; Default Application Resource Namespace
appnamespace = "YourPrefix"

; FrontController Resource Settings
resources.frontController.defaultController = "index"
resources.frontController.defaultAction = "index"
resources.frontController.defaultModule = "modulename"
resources.frontController.prefixDefaultModule = true
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.frontController.params.displayExceptions = 1

The reason you do not see anything is that the app throws errors, which are not shown due to your configuration. Try these settings:

phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1

Ensure you have SetEnv APPICATION_ENV development in your .htaccess

Upgrade Zend Framework to the newest version. Newest Zend Tool generates /docs directory with README.txt, which describes how to set up virtual host.

Hope this helps :)

And… Welcome to the SO!

Upvotes: 7

Related Questions