現在の設定では、application.ini
Zend ( ) からのデフォルト ビュー ヘルパー用の別のパスを追加するだけですZend_View_Helper_
。
使用するクラス プレフィックスを指定する必要があります。
; View_Helper_Models is the class prefix
resources.view.helperPath.View_Helper_Models = APPLICATION_PATH "/views/helpers/models"
; View_Helper_Test is the class prefix
resources.view.helperPath.View_Helper_Test = APPLICATION_PATH "/views/helpers/test"
これで、アプリケーションはクラス名をパスにマップする方法を認識しました。別の方法として、メインでこれを有効にすることができますBootstrap.php
:
protected function _initViewHelper()
{
$this->bootstrap( 'view' );
$this->_view = $this->getResource( 'view' );
$this->_view->addHelperPath( APPLICATION_PATH . '/views/helpers/models',
'View_Helper_Models' );
$this->_view->addHelperPath( APPLICATION_PATH . '/views/helpers/test',
'View_Helper_Test' );
}
注:パスは大文字と小文字を区別する必要があります。