Thinkphp 导航foreach循环如何判断是否为当前页面
代码如下:{foreachfrom=$solution_catitem=list}{if$list.user_nameneq'class'}<li><ahref="{hr...
代码如下:
{foreach from=$solution_cat item = list}
{if $list.user_name neq 'class'}
<li><a href="{href href='Solution/solution_bycatid' id =$list.cat_id}">{$list.cat_name}</a></li>
{else}
<li class="cur"><a href="{href href='Solution/solution_bycatid' id =$list.cat_id}">{$list.cat_name}</a></li>
{/if}
{/foreach}
{foreach from=$solution_cat item = list}
<li class="cur"><a href="{href href='Solution/solution_bycatid' id =$list.cat_id}">{$list.cat_name}</a></li>
{/foreach} 展开
{foreach from=$solution_cat item = list}
{if $list.user_name neq 'class'}
<li><a href="{href href='Solution/solution_bycatid' id =$list.cat_id}">{$list.cat_name}</a></li>
{else}
<li class="cur"><a href="{href href='Solution/solution_bycatid' id =$list.cat_id}">{$list.cat_name}</a></li>
{/if}
{/foreach}
{foreach from=$solution_cat item = list}
<li class="cur"><a href="{href href='Solution/solution_bycatid' id =$list.cat_id}">{$list.cat_name}</a></li>
{/foreach} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询