I have created a custom view helper and i'm calling it successfully. Only problem that i'm having is that it seems as though i'm unable to inject code into the headScript by doing the following. Everything else inside my view helper is working perfectly.
$this->view->headScript()->captureStart(); echo ' $(function() { //js code here }); '; $this->view->headScript()->captureEnd(); Any help would be appreciated.
Further investigation: Seems as though this is only happening on view helpers called from my layout. Calling the view helper from inside a view script works. I'm stumped!
More Investigation: echoing out the headscript like below works. anyone know why that is?
echo $this->view->headScript()->appendFile(filename) // works echo $this->view->headScript()->appendScript(script) // works
Zend_View_Helper_Abstract?Zend_Viewinstance you are accessing via$this->viewin the helper is not actually the same instance you bootstrapped?