Sometimes it is convenient to instantiate a view helper, and then register it with the
view. As of version 1.10.0, this is now possible using the
registerHelper() method, which expects two arguments: the
helper object, and the name by which it will be registered.
$helper = new My_Helper_Foo();
// ...do some configuration or dependency injection...
If the helper has a
setView() method, the view object will call
this and inject itself into the helper on registration.
Helper name should match a method
The second argument to
registerHelper() is the name of the
helper. A corresponding method name should exist in the helper; otherwise,
Zend_View will call a non-existent method when invoking the
helper, raising a fatal PHP error.