views:

716

answers:

1

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

+1  A: 

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.

Tim Fountain
Hi,It works correctly when I set up the site root to point at the public folder.Really have no idea why it won't work here. I had it working in the exact same way on another project last week!Thanks,Richard
Richard John