smarty

{%foreach $tplData.cntbox as $cntBox%}
    <div class="op-wisesoft-tab{%$cntBox.inmain%}-{%$cntBox.insub%}">                  
        {%foreach $tplData["app`$cntBox.inmain``$cntBox.insub`"] as $app%}
            <a href="{%$app.link%}" target="_blank">{%$app.title%}</a>
        {%/foreach%}             
        <a href="{%$cntBox.mlink%}" target="_blank">{%$cntBox.more%}</a>
    </div>
{%/foreach%}

循环套循环,并重命名变量方法,注意 $a=0,$b=1; "app`$a``$b`" => app01 注意连接符 · (~键盘)不是'(单引号)

原文地址:https://www.cnblogs.com/enone/p/2789587.html