
smarty可以在数组名称可以动态拼接吗?
PHP后台数组是$config['other1'],$config['other2'],我要用一个smarty变量代替1,2到smarty前台解释时得到$config.o...
PHP后台数组是$config['other1'],$config['other2'],我要用一个smarty变量代替1,2
到smarty前台解释时得到$config.other1或者$config.other2数组。我试过这样写不行<{$data.config.other|cat:$key}> 展开
到smarty前台解释时得到$config.other1或者$config.other2数组。我试过这样写不行<{$data.config.other|cat:$key}> 展开
2个回答
展开全部
不可以这样的哦@@。
更多追问追答
追问
我这样写当然是错的啦,我想问一下如果我要实现这种效果,用smarty模板该怎么处理
追答
一般能用php的尽量php,处理好再在模板里循环
或者,试试看{assign var="name" value="Bob"}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询