我通过我的模板字符串数组,我想转换为jaavascript数组:
控制文件(PHP):
$myVar = array('a','b','c');
所需的HTML:
var myVar = ["a","b","c"];
我尝试下面的代码(树枝):
var myVar = ["{{ myVar | join('","') }}"];
但树枝发生器引号转换为HTML实体,这是结果:
var myVar = ["a","b","c"];
一些想法?