我有关于模块的问题,我在网上搜索,但我不能让它工作。
这是我的目录结构
Layout
application
configs
Modules
default
controllers
models
views
helper
scripts
index
error
Bootstrap.php
Bootstrap.php
docs
library
DoctrineORM 2.1.5
test我的application.ini
[production]
phpSettings.display_startup_errors = 0
phpSettings.display_errors = 0
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
appnamespace = "Application"
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.modules[] =
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.params.displayExceptions = 0
resources.router.routes.home.route = /home
resources.router.routes.home.default.module = default
resources.router.routes.home.default.controller = index
resources.router.routes.home.default.action = index
[staging : production]
[testing : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1我的Bootstap.php (所有Bootstrap.php文件都是相同的)
class Bootstrap extends Zend_Application_Module_Bootstrap
}我得到的只是一张白纸。
发布于 2012-01-10 03:46:11
在基于模块的ZF应用程序中,有两种不同类型的引导程序文件:应用程序引导程序和模块引导程序。应用程序目录中的此Bootstrap.php应如下所示:
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap {}每个模块目录中的Bootrap.php应如下所示:
class ModuleName_Bootstrap extends Zend_Application_Module_Bootstrap {}(ModuleName应替换为模块的名称)。
还可以定义默认模块名称以及默认模块是否具有名称空间前缀:
resources.frontController.defaultmodule = "example"
resources.frontController.params.prefixDefaultModule = 1这将告诉frontController默认模块是example,并且该模块中的所有类都以Example_为前缀。
发布于 2012-01-08 02:14:34
如果您的配置正在查看生产设置,请确保更改
phpSettings.display_errors = 1在您的生产标签下
如果您的代码看起来与您发布的代码完全相同,则缺少一个大括号
class Bootstrap extends Zend_Application_Module_Bootstrap
{
}如果你得到一个空白页面,10次中有9次是因为display_errors没有打开。所以你看不到上面的错误。
https://stackoverflow.com/questions/8771865
复制相似问题