'Invalid controller specified' Because transition to modular structure

I installed the Zend Framework application using Zend_Tool, but I need several modules (admin and default). I moved the default controllers, models, and views to the / default modules, then created an administration module and some controllers. Then I added this line to my configuration file to specify the module directory:

resources.frontController.moduleDirectory = APPLICATION_PATH "/modules" 

Since then, I can not get my application to work correctly. If I go to http: // localhost / zfproject , it works (I get a controller-pointer / action). If I go to http: // localhost / zfproject / index / , I get "Invalid controller specified (zfproject)".

The same message appears when switching to http: // localhost / zfproject / admin . It seems that "zfproject" is the controller that I specify, even though it is just the folder where the project is located.

Thanks Richard

+4
source share
1 answer

This is not a problem that I encountered before, but ZF should detect that it is in a subfolder and works accordingly. It seems that this is not the case in your case. There are some materials in the manual that can help you:

http://framework.zend.com/manual/en/zend.controller.router.html#zend.controller.router.rewritebase

It would also be interesting to know if the application works as expected when it is in the root directory, in case there is another problem.

+2
source

Source: https://habr.com/ru/post/1286667/


All Articles