How does headScript() view helper work?
I'm using Zend_View_Helper_HeadScript to add Jav开发者_如何学编程aScript 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?
Please try
$view->headScript()->appendScript($js1)->appendScript($js2);
echo $view->headScript();
InlineScript is used if you have to add script inside your <body> Tag.
加载中,请稍侯......
精彩评论