4

I'm using Zend_View_Helper_HeadScript to add JavaScript code inside the <head> tag.

$view->headScript()->appendScript($javascript);
$view->headScript()->appendScript($javascript2);

This works fine, except that my code is full of <script> tags (one for each appendScript call). How to add $javascript2 to the same <script> tag? I just want to have one <script> tag inside the <head>.

What's the difference between headScript and inlineScript?

Adrian
  • 128
  • 1
  • 6

1 Answers1

2

Please try

$view->headScript()->appendScript($js1)->appendScript($js2);
echo $view->headScript();

InlineScript is used if you have to add script inside your <body> Tag.

opHASnoNAME
  • 20,224
  • 26
  • 98
  • 143