[英]zend framework 2 module routing
我创建了模块BookList
,在localhost/book
我收到错误:
"The requested URL /book was not found on this server."
当我尝试打开localhost/application
我收到错误:
Not Found<br>
The requested URL /application was not found on this server.<br>
Apache/2.4.18 (Ubuntu) Server at localhost Port 80
我已经确认我的zendskeleton-application实际上正在工作:
我通过设置AllowOverride All配置Apache配置解决了这个问题
你有没有在module.config.php中设置路由器?
例如在https://framework.zend.com/manual/2.3/en/user-guide/routing-and-controllers.html
如果您自己创建了模块(不使用命令提示符),则应在ProjectName / config / autoload / application.config.php中添加“模块名称” ,并在其中添加模块名称。 即
<?php
return array(
'modules' => array(
'ZendDeveloperTools',
'DoctrineModule',
'DoctrineORMModule',
'Application',
),
'module_listener_options' => array(
'module_paths' => array(
'./module',
'./vendor',
),
'config_glob_paths' => array(
'config/autoload/{{,*.}global,{,*.}local}.php',
),
),
);
在返回数组中,在“modules”下,添加您的模块名称,它将正常工作,如果有任何问题,请随时询问。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.