比方說,我在我的ini文件如下:Zend插件使用什麼目錄?
resources.frontController.plugins.auth = AuthPlugin
應該在哪裏AuthPlugin類放在哪裏?比方說,我想在控制器/插件下。
更新:
根據以下建議,我仍然有麻煩。讓我是確切什麼我目前有:
1)中的application.ini
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts"
resources.view[] =
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.plugins.authplugin.class = "AuthPlugin"
2)主要部分我bootstrap.php中沒有什麼(我有很多在那裏的東西,但仍然得到什麼也沒有錯誤):
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
}
3)我在應用程序中的AuthPlugin.php類/ plugins目錄
class AuthPlugin extends Zend_Controller_Plugin_Abstract
{
public function preDispatch(Zend_Controller_Request_Abstract $request)
{
// code here
}
}
我收到以下錯誤:
Fatal error: Class 'AuthPlugin' not found in C:\[my dir structure here]\Application\Resource\Frontcontroller.php on line 111
我假設我在這裏丟失了一些明顯的東西。提前致謝。 Zend Framework的1.10
那我一定是做錯了什麼,因爲我無法得到這個工作。我正在更新原始問題並提供更多詳細信息。 – 2010-06-29 19:35:03
我已經更新了我的答案。 – jah 2010-06-29 20:25:26
我能得到它與資源追加的工作,但我終於沒有得到它一個基本的工作需要「控制器/ AuthPlugin.php」; (或其他任何目錄)放入_initAutoloader()方法中。 – 2010-06-29 20:53:58