开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜