2021
03-05
03-05
ThinkPHP菜单无极分类实例讲解
效果图如下controller控制器代码: /***菜单列表*/publicfunctionindex(){$menuList=Db::name('menu')->order('sort,id')->select();//递归排序$menuList=$this->sort($menuList);$this->assign('menuList',$menuList);returnview();}protectedfunctionsort($data,$pid=0,$level=0){//此处数据必须是静态数组,不然递归的时候每次都会声明一个新的数组static$arr=array();forea...
继续阅读 >