I upload javascript files to bootstrap as usual, but there is a file that I want to include only if it is a page with a form
->appendFile('http://myurl.com/js/formscript.js');
Is there a way to detect a loading page from bootstrap so that I can decide whether to include this file?
I was thinking about passing a variable from form to view, and then checking this variable in bootstrap, but it does not work.
That would be in my form
$layout = new Zend_Layout();
$view = $layout->getView();
$view->formscript = true;
and it will be in my bootstrap
if ($view->formscript)
but var_dump($view->formscript)give me null, so any other ideas to activate js files only under certain conditions?
source
share