Thinkphp的html里面可以使用PHP变量,JS里面使用不了PHP变量

可以在js里面这样使用:

 

var currencyType = 'xxx';

var langTemplate = '<?= lang("recharge_tip1", ["'+ currencyType +'"]) ?>';

 

 

也可以直接使用php原生标签<?php  ?>

posted @ 2025-11-19 16:34  幽暗天琴  阅读(4)  评论(0)    收藏  举报