简体   繁体   English

在magento的HEAD标签之间包含模板.phtml

[英]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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM