I want to include external js file in my php script. I am following zend framework.Right now I am adding js file in controller\'s init function like this.
pu
In above solution the 'path/to/file.js' script will be included in the header twice. There is no need for echo
before calling prependFile
. Such behaviour can lead to duplicating javascript controls.
headScript()->prependFile(
$this->baseUrl('path/to/file.js')) // this will echo out the whole prependFile queue