Zend MVC:: 如何使用 javascript 文件 + javascript代码插入到头部或身体区域的局部?
如何将javascript文件+javascript代码插入到头部或身体区域的局部?
[内部视图只需调用插入到 HeadScript 和正文 InlineScript - 这在部分内部不起作用(如果我错了,请写)。 ]
谢谢,
约瑟夫
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我还没有尝试过这个,但是您是否尝试过在您的部分中使用以下代码
我知道您说它不起作用,但也许它是您获取视图实例的方法?
理论上它应该有效。
I have not tried this, but have you tried using the following code inside your partial
I know you were saying it doesn't work, but maybe its the method your getting your view instance?
In theory it should work.
我知道这已经过时了,但也许像我一样的其他人也有同样的问题:
确保在回显您的头脚本/链接之前渲染您的部分内容;)
花了一段时间才弄清楚,..但它确实有一定程度的逻辑:p
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
为我尝试这个工作:D
try this work for me :D