phpcms 这样条件的栏目怎样调用呢
条件是:parentid 等于1的所有栏目,我想调出来,不知如何写啊
我这样写:
{pc:content action="category" parentid="1" num="25" siteid="$siteid" order="listorder ASC"}
{loop $data $r}
<br /> /**<br /> * 栏目标签<br /> * @param $data<br /> */<br /> public function category($data) {<br /> $data['catid'] = intval($data['catid']);<br /> $array = array();<br /> $siteid = $data['siteid'] && intval($data['siteid']) ? intval($data['siteid']) : get_siteid();<br /> $categorys = getcache('category_content_'.$siteid,'commons');<br /> $site = siteinfo($siteid);<br /> $i = 1;<br /> foreach ($categorys as $catid=>$cat) {<br /> if($i>$data['limit']) break;<br /> if((!$cat['ismenu']) <br><font color='#FF8000'>------解决思路----------------------</font><br> $siteid && $cat['siteid']!=$siteid) continue;<br /> if (strpos($cat['url'], '://') === false) {<br /> $cat['url'] = substr($site['domain'],0,-1).$cat['url'];<br /> }<br /> if($cat['parentid']==$data['catid']) {<br /> $array[$catid] = $cat;<br /> $i++;<br /> }<br /> }<br /> return $array;<br /> }<br /> <br />