未捕获异常';Zend_Acl_Exception';带有消息';找不到资源';


Uncaught exception 'Zend_Acl_Exception' with message 'Resource not found'

我是Zend Framework的新手,我正在尝试使用它来构建一个小型网站。因此,为了构建CMS,我在作者Forrest Lyman的Apress网站上找到了一个源代码。我还从当地市场买了这本书。

我想单独拥有管理模块,所以我创建了管理模块,但我遇到了问题,因为我无法访问IndexController以外的控制器。当我试图访问管理模块中的其他控制器时,我得到了这个错误:

致命错误:未捕获异常"Zend_Acl_exception",消息"Resource"类别在C:''Server''ZendServer''share''ZendFramework''library''Zend''Acl.php中"未找到":365堆栈跟踪:#0 C:''Server''ZendServer''sshare''ZendFramework ''library ''Zend''Acl.php(846):Zend_Acl->get("类别")#1 C:''Server:Zend''Apach2''htdocs''cms''library''cms''Controller''Plugin''Acl.php(52):Zend-Acl->isAllowed("管理员"、"类别"、"索引")#2 C:''Server''ZendServer''share''ZendFramework''library''Zend''Controller''Plugin''Proker.php(309):CMS_Controller_Plugin_Acl->preDispatch(对象(Zend_Controller_Request_Http)C: ''Server''Zend''Server''share''ZendFramework''library''Zend''Application''Bootstrap''Bootstrap.php(97):Zend_Controller_Front->dispatch()#5 C:''Server''ZendServer''share''ZendFramework''library''Zend''Application.php(366):Zend-Application_Bootstrap->run

我找到了解决方案。。

制作控制器后,我必须在Acl.php文件中添加资源,该文件位于(library/CMS/controller/Plugin/)中。只需在添加资源部分中添加此项

 $acl->add(new Zend_Acl_Resource('category'));

然后你可以访问它。

谢谢。

相关文章: