在phpcms9的模板引擎中使用变量

最初发表于: 2020-02-14 15:38:13

示例代码如下

    <?php foreach ($arr as $v) { ?>
        {pc:content action="lists" catid="$v" num="1" order="id DESC" moreinfo="1"}
        <!-- 看上文的$v -->
        {loop $data $r}
        <a href="{$r[url]}">
            <div class="electronics-list clearfix">
                <div class="electronics-list-left pull-left"><img src="{$r[thumb]}"></div>
                <div class="electronics-list-right pull-left">
                    <p class="electronics-list-title">{$r[title]}</p>
                    <span class="electronics-list-desc">{$r[description]}</span>
                </div>
            </div>
        </a>
        {/loop}
        {/pc}
    <?php } ?>