2

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

Jiew Meng
  • 84,767
  • 185
  • 495
  • 805

1 Answers1

7

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!

takeshin
  • 49,108
  • 32
  • 120
  • 164
  • thanks but now i got `Invalid controller specified (index) ` but indexController is generated by Zend_Tool which seems valid – Jiew Meng Mar 14 '10 at 02:46
  • Zend Tool generates files in standard location, so you don't have to modify the app structure. If you modify it, Zend Tool generates files in wrong location. Take a look at [Quickstart tutorial](http://framework.zend.com/manual/en/learning.quickstart.intro.html). – takeshin Mar 14 '10 at 09:17