在模板里调用主导航及二级导航
- <!--navs--> <!--{eval $m_nav = C::t(common_nav)->fetch_all_mainnav();}--> <!--{loop $m_nav $nav}--> <!--{if $nav['available'] && (!$nav['level'] || ($nav['level'] == 1 && $_G['uid']) || ($nav['level'] == 2 && $_G['adminid'] > 0) || ($nav['level'] == 3 && $_G['adminid'] == 1))}--> <!--{eval $s_navs = C::t(common_nav)->fetch_all_subnav($nav['id']);}--> <!--{if $s_navs }--> <div class="nav_list"><a href="$nav[url]">$nav[name]</a> <ul> <!--{loop $s_navs $subnavs}--> <!--{if $subnavs['parentid'] == $nav[id]}--> <li><a href="$subnavs[url]">$subnavs[name] </a></li> <!--{/if}--> <!--{/loop}--> </ul> </div> <!--{else}--> <div class="nav_home"><a href="$nav[url]">$nav[name]</a> </div> <!--{/if}--> <!--{/if}--> <!--{/loop}--><!--navs end-->
自己研究的笨方法 希望大家多多指教