如何在smarty for Javascript中创建Php数组和呈现?
我使用php作为后端,并将关联数组传递给模板。我的模板使用smarty 2.6.18 php:如何在smarty for Javascript中创建Php数组和呈现?,php,json,smarty,Php,Json,Smarty,我使用php作为后端,并将关联数组传递给模板。我的模板使用smarty 2.6.18 php: $a=数组(“abc”=>“abc”) 模板: var check=$a |@json_enode 此var检查返回“{}” 无法理解smarty中json_编码的行为。在使用更高版本的smarty时。我认为在这个版本中可能还有另一种方法。有人能帮忙吗?你是说json\u encode你是说json\u encode
$a=数组(“abc”=>“abc”)代码>
模板:
var check=$a |@json_enode代码>
此var检查
返回“{}”代码>
无法理解smarty中json_编码的行为。在使用更高版本的smarty时。我认为在这个版本中可能还有另一种方法。有人能帮忙吗?你是说json\u encode
你是说json\u encode