Details
Description
From a request on the FW-MVC mailing list, Zend_View should offer a way to register helper objects without relying on the plugin loader. This would allow for dependency injection, objects that don't follow the PEAR naming convention, and PHP 5.3 namespaces.
I'm putting together a patch that will allow registering custom helpers like this:
// Adding a custom helper
$view = new Zend_View();
$helper = new MyCustomHelper();
$view->addHelper($helper, 'foo');
$view->foo(); // calls MyCustomHelper#foo()
// Overwriting a built-in helper
$myUrlHelper = new MyUrlHelper();
$view->addHelper($myUrlHelper, 'url');
$view->url(); // calls MyUrlHelper#url();
Any thoughts on this?