zend-framework - 更改 Zend Framework 默认模块

标签 zend-framework zend-framework-modules

我正在开发一个项目并具有以下项目布局:

|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/

相关文章:

zend 格式的 mysql 查询

php - Zend 路由和数据库映射

php - 如何在zend框架中进行Backing

php - 打包通用 zend 模块的最佳方式

php - 配置 ZF2 view_manager 以加载 2 个单独的模板映射

zend-framework2 - ZF2 : Controller's Forward plugin doesn't work. 如何让它工作?

php - 如何在 Zend 中正确设置异常处理程序?

php - zend框架如何连接数据库?

zend-framework - 将 Zend Framework 项目移至 Ubuntu 并停止工作

zend-framework - 如何下载 Zend_Jabber 库?