假设我的ini文件中包含以下内容:
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)我在application/plugins目录中有一个AuthPlugin.php类
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