开发者

Zend MVC:: How can javascript file + javascript code inserted to partial for head or body area?

How can javascript file + javascript code inserted to partial for head or body area?

[Inside view simply call for insert to head to HeadScript and to body InlineScript - this not works inside partial(If I am wrong please write). ]

开发者_开发知识库

Thanks,

Yosef


I have not tried this, but have you tried using the following code inside your partial

$view = Zend_Layout::getMvcInstance()->getView();

$view->headScript()->appendFile('/scripts/somefile.js');

I know you were saying it doesn't work, but maybe its the method your getting your view instance?

In theory it should work.


I know this is far out of date, but maybe other like me having the same problem:

Make sure that you render your partial BEFORE you echo your headscript/links ;) Took a while to figure out,.. but it does have some degree of logic in it :p


try this work for me :D

<?php echo '<?php $this->headScript()->appendFile ($this->baseUrl(). "/js/jquery.jplayer.min.js" );?>';?>
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜