0

Zend フレームワークでプラグインを作成し、このプラグインを bootstrap.php に登録しました。しかし、私のページにはエラーが表示されています

クラス 'Application_Plugin_CheckAuthentication' が bootstrap.php ファイルに見つかりません。

私のプラグイン登録コードは以下の通りです:

    function _initViewHelpers() { 
$frontController = Zend_Controller_Front::getInstance();
$frontController->registerPlugin(new Application_Plugin_CheckAuthentication());
}

これはプラグインフォルダーを取得していないと思います。誰でも助けることができますか?

ありがとう。

4

1 に答える 1

0

実際のファイルはどこにありますか?

ファイルが にある場合、/application/pluginsまたはおそらく/application/modules/mymodule/pluginsautolaoder がそれを見つけて自動ロードする必要/pluginsがあります

ファイルが他の場所にある場合は、パスを登録する必要があります。

//in the application.ini
pluginPaths.Application_Plugin = APPLICATION_PATH "/../library/Application/Plugin"

//in the bootstrap, or anywhere else really.
//there may be other syntax available...
$loader = new Zend_Loader_PluginLoader();
$loader->addPrefixPath($prefix, $path);

オートローダーがどこを見ればよいかを認識したら、すべてが機能するはずです。

于 2012-12-15T08:14:10.270 に答える