Richard John
Richard John

Reputation: 487

'Invalid controller specified' Since Moving to Modular Structure

I set up a Zend Framework application using Zend_Tool, but I wanted multiple modules (admin and default). I moved the controllers, models and views for default into modules/default, then created an admin module and some controllers. I then added this line to my config file to specify the modules directory:

resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"

Since doing this, I can't get my app to work properly. If I go to http://localhost/zfproject, it works (I get the index controller/action). If I go to http://localhost/zfproject/index/, I get 'Invalid controller specified (zfproject)'.

The same message appears when going to http://localhost/zfproject/admin. It seems to think 'zfproject' is the controller I'm specifying, despite that just being the folder the project is contained in.

Thanks, Richard

Upvotes: 4

Views: 3278

Answers (1)

Tim Fountain
Tim Fountain

Reputation: 33148

This isn't a problem I've experienced before, but ZF should detect that it is in a sub folder and work accordingly. It seems that in your case it is not doing so. There is some stuff in the manual that might help you:

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

it'd also be interesting to see whether the app works as expected when it is in the root directory, just in case there's another problem.

Upvotes: 2

Related Questions