function index() { $list = M("Menu")->order("sort desc,id asc")->select(); vendor("Tree.Tree"); $tree = new Tree(); $tree->Tree($list, 'pid'); $list = $tree->getArray(); foreach ($list as $key => $val) { $list[$key]['count'] = M("Menu")->where("pid=" . $val['id'])->count(); } $this->assign('list', $list); $this->display('index'); }
function KBTree($name) { parent::Tree($name); }
function CategoryTree($root, $root_type = ROOT_TYPE_ID) { $this->_table = "categories"; parent::Tree($root, $root_type); }
function ConfigTree($root, $root_type = ROOT_TYPE_ID) { $this->_table = "config"; parent::Tree($root, $root_type); }