[英]Including template .phtml between HEAD tags in magento
I need in including some my .phtml
template between tags 我需要在标签之间包含一些
.phtml
模板
<head> </head>
My template generates some JS code with PHP therefore I need in .phtml
template instead simple 我的模板使用PHP生成了一些JS代码,因此我需要
.phtml
模板而不是简单
<action method="addJs"><script>theme/script.js </script> </action>
Thanks 谢谢
Add to your xml: 添加到您的xml:
<reference name="head">
<action method="addItem"><type>skin_js</type><name>js/script.js</name><params/></action>
</reference>
And add your script to skin/frontend/[template]/[package]/js/script.js
并将您的脚本添加到
skin/frontend/[template]/[package]/js/script.js
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.