我正在开发一个项目并具有以下项目布局:
|Project
|-Application
|-api
|-configs
|-controllers
|-models
|-modules
|-core
|-controllers
|-models
|-views
|-Bootstrap.php
|-site1
|-site2
|-site3
|-views
|-Bootstrap.php
|-Docs
|-Library
|-Public
|-.zfproject.xml
我在 application.ini 中使用它来尝试设置
default
模块为core
模块:resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.frontController.defaultModule = "core"
resources.frontController.defaultControllerName = "Index"
resources.frontController.defaultAction = "index"
resources.modules[] = ""
我的问题是,由于某种原因,我无法让 Bootstrap 在模块中工作。就好像默认模块没有被更改一样。该应用程序的行为就像它一样,直到我尝试加载 Bootstrap - 我收到此错误:
Fatal error: Uncaught exception 'Zend_Application_Resource_Exception' with message 'Bootstrap file found for module "default" but bootstrap class "Default_Bootstrap" not found' in M:\Zend_Framework\library\Zend\Application\Resource\Modules.php on line 85
以此错误为前缀:
Zend_Application_Resource_Exception: Bootstrap file found for module "default" but bootstrap class "Default_Bootstrap" not found in M:\Zend_Framework\library\Zend\Application\Resource\Modules.php on line 85
谁能看到我哪里出错了?
我的应用程序/Bootstrap.php 文件:
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
}
我的应用程序/核心/Bootstrap.php 文件:
class Core_Bootstrap extends Zend_Application_Module_Bootstrap
{
}
最佳答案
不是 100%,但如果您删除以下行:
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
这可能会解决问题。如果我没记错的话,当您使用模块时,设置它会导致错误。
关于zend-framework - 更改 Zend Framework 默认模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9034797/