调用代码:
<ul class="layui-clear"> {eval $headernavlist = $this->fromcache("headernavlist");} {loop $headernavlist $headernav} {if $headernav['type']==1 && $headernav['available']} <li class="{if strstr($headernav['url'],$regular)} layui-this{/if}"> <a href="{$headernav['format_url']}" title="{$headernav['title']}">{$headernav['name']}</a> </li> {/if} {/loop} </ul>
解说:
从导航文件缓存中取出数据
{eval $headernavlist = $this->fromcache("headernavlist");}
然后利用 loop标签循环遍历$headernavlist