更改Zend Framework默认模块 [英] Change Zend Framework Default Module

查看:117
本文介绍了更改Zend Framework默认模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在一个项目上,并且具有以下项目布局:

I'm working on a project and have the following project layout:

|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模块:

I've used this in my application.ini to try and set the default module to be the core module:

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[] = ""

我的问题是由于某种原因,我无法在模块中使用引导程序.几乎就像没有更改默认模块一样.在我尝试加载引导程序之前,该应用程序的行为与原来一样-我收到此错误:

My problem is that for some reason, I can't get bootstraps working in the modules. It's alsmost as if the default module isn't being changed. The application behaves like it is, until I try and load the bootstraps - I get this error:

致命错误:未捕获的异常'Zend_Application_Resource_Exception' 消息为模块默认"找到引导文件,但引导 找不到"Default_Bootstrap"类 M:\ Zend_Framework \ library \ Zend \ Application \ Resource \ Modules.php在 第85行

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:找到模块的引导文件 默认",但找不到引导类"Default_Bootstrap" M:\ Zend_Framework \ library \ Zend \ Application \ Resource \ Modules.php在 第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

谁能看到我要去哪里错了?

Can anyone see where I'm going wrong?

我的Application/Bootstrap.php文件:

My Application/Bootstrap.php file:

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
}

我的Application/Core/Bootstrap.php文件:

My Application/Core/Bootstrap.php file:

class Core_Bootstrap extends Zend_Application_Module_Bootstrap 
{   
}

推荐答案

不是100%,但是如果您删除以下行:

Not 100% on this but if you remove the following line:

resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"

这可能会解决问题.如果我没记错的话,那么当您使用模块时,设置此项会导致错误.

that may resolve the issue. If i'm not mistaken, as you're using modules, setting this will cause an error.

这篇关于更改Zend Framework默认模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆