我刚刚开始学习zend 框架 /questions/tagged/zend-framework并遵循此用户指南 http://framework.zend.com/manual/2.3/en/index.html.
我能够成功安装zend skeleton application http://framework.zend.com/manual/2.3/en/user-guide/skeleton-application.html并继续进行routing and controllers http://framework.zend.com/manual/2.3/en/user-guide/routing-and-controllers.html。但完成教程后我请求了网址:http://zf2-tutorial.localhost/album
在我的浏览器中,我得到了404
.
我低头看了一些评论,其中有人说关于变化
'route' => '/album[/][:action][/:id]'
需要是
'route' => '/album[/:action][/:id]'
但这也无济于事。谁能帮我解决这个问题?
目录结构:
谢谢Crisp https://stackoverflow.com/users/1112089/crisp用于提及 urlcomment https://stackoverflow.com/questions/22758907/404-the-requested-url-could-not-be-matched-by-routing/22760520#comment34695703_22758907.
有一个缺少链接 http://framework.zend.com/manual/2.3/en/user-guide/modules.html之间zend 骨架应用程序 http://framework.zend.com/manual/2.3/en/user-guide/skeleton-application.html and 路由和控制器 http://framework.zend.com/manual/2.3/en/user-guide/routing-and-controllers.html其中写入初始模块结构和模块文件代码。
我的代码Module.php
失踪的是
use Zend\ModuleManager\Feature\AutoloaderProviderInterface;
use Zend\ModuleManager\Feature\ConfigProviderInterface;
class Module implements AutoloaderProviderInterface, ConfigProviderInterface {
public function getAutoloaderConfig()
{
return array(
'Zend\Loader\StandardAutoloader' => array(
'namespaces' => array(
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
),
),
);
}
public function getConfig() {
return include __DIR__ . '/config/module.config.php';
}
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)