您的位置:首页 > 编程语言 > PHP开发

php面包屑导航

2017-03-27 10:42 134 查看
public function getFamily($cat_id){//获取面包屑导航
$tree=array();
$cats=$this->cats;

while($cat_id>0){
foreach($cats as $v){
if($v['cat_id']==$cat_id){
$tree[]=$v;
$cat_id=$v['parent_id'];

}
}
}

return array_reverse($tree);
}
public function family($parent_id){//php更改family
$trees=$this->getFamily($parent_id);

$flag=true;
foreach($trees as $v){
if($v['cat_id']==I('get.cat_id')){
$flag=false;
}
}
return $flag;
}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: