简体   繁体   中英

Zend Framework Modules Issues

I am running Zend Framework 1.11.10 on Ubuntu 11.10. I have created 3 modules named "admin", "music", "movies". But when I visit "/admin", "/music" or "/movies", I get a 404 error.

I have tried different combinations of autoloaders in both application.ini and bootstrap but none worked. So, I have created yet another fresh project. Created the modules, turned on error reporting and here is the source code: https://bitbucket.org/masnun/zf-modules/src

I really can't find what's going wrong. I want "/admin" to load the admin module (admin/index/index").

Any helps?

Regards, Masnun

The project in the repository is not configured for use with modules. The easiest way to get things going, is to put app/controllers and app/views in a module default and then switch the following in your application.ini:

resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
-->
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"

After that the URLs /{module}/{controller}/{action} should work, if no module is specified, default will be used.

For ZF to recognize resources from modules, you should place a bootstrap.php in each module's folder containing the following:

class {MODULE}_Bootstrap extends Zend_Applocation_Module_Bootstrap {}

and add resources.modules[] = "" to your application.ini

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM