我有一个具有这种结构的 ZF1.12 项目:
|Project
|-Application
|-configs
|-application.ini
|-modules
|-default
|-configs
|-controllers
|-models
|-views
|-Bootstrap.php
|-api
|-configs
|-controllers
|-models
|-views
|-Bootstrap.php
|-Bootstrap.php
|-Library
|-Public
application.ini 中的模块配置
resources.modulesetup[] =
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.frontController.defaultControllerName = "index"
resources.frontController.defaultAction = "index"
resources.frontController.defaultModule = "default"
resources.modules[] = ""
这些链接
$this->url(array('module'=>'default', 'controller'=>'index', 'action'=>'index'));
$this->url(array('module'=>'default', 'controller'=>'index', 'action'=>'one'));
$this->url(array('module'=>'admin', 'controller'=>'index', 'action'=>'index'));
$this->url(array('module'=>'admin', 'controller'=>'index', 'action'=>'two'));
在 /project.com/ 返回
/project.com/ ---> works
/project.com/ ---> no module, no controller and no action...
/project.com/admin/ ---> works
/project.com/admin/ ---> no controller and no action...
和 /project.com/default/ 上的相同链接返回
/project.com/ ---> works
/project.com/index/one ---> doesn't work and return 404 error
/project.com/admin/index/index ---> works
/project.com/admin/index/two ---> works
有什么不对,当然,我应该总是有同样的回报。第二个也给我一个 404 错误。 如果我把它放在浏览器的地址栏中,我发现了类似/project.com/default/index/one的东西。
为什么 url() 方法不返回包含“默认”模块的 url?