Reputation: 6848
I've read a book titled zend framework: beginner's guide. It was mentioned that it's best practice to create modules and categorize things.
I've added the modules directory to the application directory and moved views,controllers and models directory into it. The structure is as below:
application
when I pop open the browser and surf to the following URLs:
localhost/square/default/index/index
OR
localhost/square/public/default/index/index
I get not found
error message. I've changed the configuration file (application.ini) as below:
resources.frontcontroller.controllerDirectory = APPLICATION_PATH "/modules/default/controllers"
resources.frontcontroller.params.displayExceptions = 0
resources.frontcontroller.moduleDirectory = APPLICATION_PATH "/modules"
resources.modules = ""
I've read the following questions, but that didn't help:
Change Zend Framework Default Module
Zend Framework not include the default module in url
Upvotes: 0
Views: 700
Reputation: 2643
Just use this instead :
resources.frontcontroller.controllerDirectory = APPLICATION_PATH "/controllers"
EDIT :
I noticed that you use localhost/square/ to access your pages. You have to setup a virtual host to fix your problem since the router need it to work properly.
Upvotes: 1
Reputation: 5342
this should work.
resources.modules[] = ""
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.frontController.moduleControllerDirectoryName = "controllers"
resources.frontController.defaultModule = "default"
resources.frontController.defaultControllerName = "index"
resources.frontController.defaultAction = "index"
resources.frontController.env = APPLICATION_ENV
Upvotes: 1