2012-04-16 113 views
1

我已經包含插件SecurityCheck.php (Login_Plugin_SecurityCheck) in bootstrap.php。它的錯誤 - >Call to undefined method Zend_Application::getResource() in Bootstrap.php在第9行。下面是我的代碼。無法訪問資源插件

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap 
{ 
protected function _initPlugins() 
    { 

     $bootstrap = $this->getApplication(); 

     $bootstrap->bootstrap('frontcontroller'); 

     $front = $bootstrap->getResource('frontcontroller'); 

     $front->registerPlugin(new Login_Plugin_SecurityCheck()); 
    } 
} 

如何解決此錯誤。

回答

0

試試這個

protected function _initPlugins() { 
    $this->bootstrap('frontController')->getResource('frontController')->registerPlugin(new Login_Plugin_SecurityCheck()); 

} 

frontcontroller的C應該captial。

+0

謝謝初學者,完成............................................ ......但現在它的錯誤提示 - > Class'Login_Plugin_SecurityCheck'找不到。我已將這個插件包含在C:\ xampp \ htdocs \ zend \ bin \ zendtest \ application \ plugins中 – Navdeep 2012-04-16 06:33:35

+0

如何接受答案,不知道如何去 – Navdeep 2012-04-16 06:37:20

+0

http://i.stack.imgur.com/uqJeW.png – 2012-04-16 06:41:07