我越来越想在我的Zend框架应用程序中使用一个模块化的布局时,下面的错误工作:如何获得模块在Zend框架
未定义指数:认证在C:\ PHP \包括\ Zend公司\控制器\调度\ Standard.php上线385
下面的代码此错误之前运行:
if (!$this->_acl->isAllowed($role, $resource, $privilege)) {
$request->setModuleName('authentication');
$request->setControllerName('auth');
$request->setActionName('login');
$request->setDispatched(false);
}
在我的引导
,我有:
$frontController
->setParam('environment', $this->environment)
->setControllerDirectory(ROOT_DIR . '/controllers')
->addModuleDirectory(ROOT_DIR . '/modules');
和我的目录结构是:
/ application
/controllers
/models
/views
/library
/modules
/Authentication
/controllers
AuthController.php
任何思考为什么不工作?
谢谢彼得,那当然摆脱了那个错误信息。不幸的是,另一个出现在它的地方: PHP致命错误:在C:\ PHP \ includes \ Zend \ Controller \ Dispatcher \ Standard.php中带有消息'Invalid controller class(“Authentication_AuthController”)'的未捕获异常'Zend_Controller_Dispatcher_Exception':353 我还没有定义一个默认模块 - 我想我可以直接在应用程序目录下保存我的应用程序特定文件 - 这不是这种情况吗? (我看到我上面的目录结构是错误的 - 我现在已经制作了应用程序的所有文件夹子目录)。 – Iain 2009-04-30 16:59:38
好的 - 错误信息是因为我需要命名我的控制器类与Module_Controller约定,而不是只是控制器,对吗?所以Authentication_AuthController而不仅仅是AuthController。 – Iain 2009-04-30 17:10:26