I want to add custom view helper in zend framework like this:
- I placed in application.ini this code:
includePaths.library = APPLICATION_PATH "/../library"
and create library directory in myproject root - create view helper TabEntry.php in library directory
class Zend_View_Helper_TabEntry extends Zend_View_Helper_Abstract {
public function TabEntry() {
}
} - create another view helper TabEntries.php in library directory
class Zend_View_Helper_TabEntries extends Zend_View_Helper_TabEntry {
public function TabEntries() {
}
} - when in my phtml use $this->TabEntries() get error
- in Bootstrap.php I add some code:
$view->addHelperPath('MyView/Helpers', "library_MyView_Helpers");
$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
$viewRenderer->setView($view);
Best Answer
According to ZF coding application structure, correct version would be:
In application.ini:
Then the helpers: (not sure why do you need another abstract class):
In the view:
Important:
call_user_func
and Linux filesystem are case sensitive.