<ul class="h-hover-in"> <li> <a href="{:U('News/Index/news',array('catid'=>110))}#toutiao" target="_blank" class="h-logined-active">頭條</a> </li> <li> <a href="{:U('News/Index/news',array('catid'=>101))}#jianguan" target="_blank" class="h-logined-active">監(jiān)管</a> </li> <li> <a href="{:U('News/Index/news',array('catid'=>112))}#huodong" target="_blank" class="h-logined-active">活動(dòng)</a> </li> <li> <a href="{:U('News/Index/news',array('catid'=>113))}#pingce" target="_blank" class="h-logined-active">評(píng)測(cè)</a> </li> <li> <a href="{:U('News/Index/news',array('catid'=>114))}#gonggao" target="_blank" class="h-logined-active">公告</a> </li>
2 回答

元芳怎么了
TA貢獻(xiàn)1798條經(jīng)驗(yàn) 獲得超7個(gè)贊
在模板中使用U函數(shù)如果有參數(shù)的話是有規(guī)范寫(xiě)法的,是在后面使用一個(gè)數(shù)組來(lái)傳遞例如:
{:U(GROUP_NAME.'/Index/edit',array('id'=>1,'uid'=>3))}
thinkphp是分頁(yè)是能夠自動(dòng)區(qū)分分組的,所以你直接在模板中使用分配的頁(yè)碼變量{$page}

慕村225694
TA貢獻(xiàn)1880條經(jīng)驗(yàn) 獲得超4個(gè)贊
改為<a href="/{:U('News/Index/news',array('catid'=>110))}#toutiao" target="_blank" class="h-logined-active">頭條</a>
- 2 回答
- 0 關(guān)注
- 242 瀏覽
添加回答
舉報(bào)
0/150
提交
取消