Hi am trying to add custom helper throughout my application
Have done following steps
index.php
$view = new Zend_View(); $view->addHelperPath('My/View/Helper', 'My_View_Helper'); Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
Helper class in My/View/Helper
class My_View_Helper_Common extends Zend_View_Helper_Abstract {
public function example()
{
return "ok";
}
}
- now calling in view index.phtml
$this->example()
am getting this error
Uncaught exception 'Zend_View_Exception' with message 'script 'error/error.phtml' not found in path (.\application\views\scripts)' in C:\xampp\htdocs\wyfixture\library\Zend\View\Abstract.php:924 Stack trace: #0 C:\xampp\htdocs\wyfixture\library\Zend\View\Abstract.php(827): Zend_View_Abstract->_script('error/error.pht...') #1 C:\xampp\htdocs\wyfixture\library\Zend\Controller\Action\Helper\ViewRenderer.php(903): Zend_View_Abstract->render('error/error.pht...') #2 C:\xampp\htdocs\wyfixture\library\Zend\Controller\Action\Helper\ViewRenderer.php(924): Zend_Controller_Action_Helper_ViewRenderer->renderScript('error/error.pht...', NULL) #3 C:\xampp\htdocs\wyfixture\library\Zend\Controller\Action\Helper\ViewRenderer.php(963): Zend_Controller_Action_Helper_ViewRenderer->render() #4 C:\xampp\htdocs\wyfixture\library\Zend\Controller\Action\HelperBroker.php(277): Zend_Controller_Action_Helper_ViewRenderer->postDispatch() #5 C:\xampp\htdocs\wyfixture\library\Zend\Controller\Action.php(523):
please help me