Php 在Smarty中包含阵列密钥
来自Smarty文档:Php 在Smarty中包含阵列密钥,php,smarty,Php,Smarty,来自Smarty文档: {* include a multi $variable template - eg amber/links.view.tpl *} {include file="$style_dir/$module.$view.tpl"} 但我希望数组键的值包含我以前在php中创建的smarty。访问数组键的值很简单,如下所示:$array.key。但是当我想在include字符串中访问它时呢 {include file="$array.key"} is equals to "$ar
{* include a multi $variable template - eg amber/links.view.tpl *}
{include file="$style_dir/$module.$view.tpl"}
但我希望数组键的值包含我以前在php中创建的smarty。访问数组键的值很简单,如下所示:$array.key
。但是当我想在include字符串中访问它时呢
{include file="$array.key"} is equals to "$array".key
嗯。我可以处理这个问题:
{include "modules/{$array.key}.tpl" style="{$array.key}"}