This article brings you the content is about TP5 to achieve the site breadcrumb navigation code, there is a certain reference value, the need for a friend can refer to, I hope you have some help.
Breadcrumbs Navigate or call the current location
Breadcrumb navigation Public Function position ($CID) {//Pass the current column idstatic $pos =array ();//Create an array that accepts breadcrumb navigation if (empty ($pos)) {//Oh, this is more important, Add $cates=db (' Cate ')->field (' id,cate_name,pid,cate_attr ')->find ($CID) If you need to place the current column in the Breadcrumb navigator. $pos []= $cates ;} $data =db (' Cate ')->field (' id,cate_name,pid,cate_attr ')->select ();//All column information $cates=db (' Cate ')->field (' ID, Cate_name,pid,cate_attr ')->find ($cid);//Current Column information foreach ($data as $k = = $v) {if ($cates [' pid ']== $v [' id ']) {$pos []= $v; $this->position ($v [' id ']);}} Return Array_reverse ($pos);}