Jason Austin wrote:
>
> When I create a
> My_View_Helper_Translate it will ignore my helper in favor of the
> default one. Any idea how to make the view helper use my translate
> helper as opposed to the default one?
>
I had exactly the same problem. I solved this as follows.
Put this in your bootstrap:
$view = new Zend_View();
$view->addHelperPath('../library/My/View/Helper', 'My_View_Helper');
$vr = new Zend_Controller_Action_Helper_ViewRenderer();
$vr->setView($view);
Zend_Controller_Action_HelperBroker::addHelper($vr);
Now Zend will first look in library/My/View/Helper/ for view helpers.
However, this seems rather complicated compared to action helpers. Action
helpers are automatically found in /library/My/Action/Helper/ by the
one-liner:
Zend_Controller_Action_HelperBroker::addPrefix('My_Action_Helper');
I still think there must be a better solution for view helpers as well!
Anyone an idea?
--
View this message in context:
http://www.nabble.com/Overwriting-a-default-view-helper-tp21461708p21874631.html
Sent from the Zend Framework mailing list archive at Nabble.com.