本文整理汇总了PHP中tree::treeFormat方法的典型用法代码示例。如果您正苦于以下问题:PHP tree::treeFormat方法的具体用法?PHP tree::treeFormat怎么用?PHP tree::treeFormat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tree
的用法示例。
在下文中一共展示了tree::treeFormat方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _initialize
protected function _initialize()
{
/* 读取站点配置 */
$config = api('Config/lists');
C($config);
//添加配置
if (!C('WEB_SITE_CLOSE') && $_SESSION[C('USER_AUTH_KEY')] != 1) {
$this->error('站点已经关闭,请稍后访问~', '', 1000);
}
$a = D('Member')->need_login();
$field = array('uid', 'username', 'nickname', 'name', 'email', 'space_url', 'reg_time', 'last_login_time', 'signature', 'avatar32', 'avatar64', 'avatar128', 'avatar256');
$userinfo = query_user($field, $_SESSION['cs_home']['user_auth']['uid']);
$roleauth = getmroleauth();
checkscore($_SESSION['cs_home']['user_auth']['uid']);
$mymail['status'] = 1;
$mymail['is_read'] = 0;
$mymail['to_uid'] = $_SESSION['cs_home']['user_auth']['uid'];
$mymailcount = M('Message')->where($mymail)->count();
$userinfo['mymailcount'] = empty($mymailcount) ? '' : $mymailcount;
$isadmin = is_admin($_SESSION['cs_home']['user_auth']['uid']);
$this->assign('isadmin', $isadmin);
$this->assign('user_auth', session('user_auth'));
$this->assign('uid', getnowUid());
$this->assign('userinfo', $userinfo);
$this->assign('roleauth', $roleauth);
//得到会员组权限
$cname = strtolower(CONTROLLER_NAME);
$aname = strtolower(ACTION_NAME);
$this->assign('aname', $aname);
$this->assign('cname', $cname);
$cate = new CategoryApi();
$clist = $cate->get_catelist(0);
$clistnum = $cate->get_editcnum();
$this->assign('clist', $clist);
$nosigncate = M('Cate')->where(array('status' => 1, 'type' => 1))->select();
$m = D('cate');
$catelist = $m->field('*,CONCAT(spid,id) as path2')->where(array('type' => 1, 'status' => 1))->order('path2')->select();
$t = new tree();
$catelistarr = $t->unlimitCategoryFormat($catelist);
$catehtml = $t->treeFormat($catelistarr);
$this->assign('catehtml', $catehtml);
$this->assign('nosigncate', $nosigncate);
$this->assign('clistnum', $clistnum);
$nav = D('nav')->where(array('status' => 1))->order('sort desc')->select();
foreach ($nav as $key => $vo) {
$nav[$key]['url'] = navurl($vo['id'], $vo['type']);
$nav[$key]['active'] = navactive($vo['id'], $vo['type']);
if ($vo['win']) {
$nav[$key]['target'] = '_blank';
} else {
$nav[$key]['target'] = '_self';
}
}
$this->assign('nav', $nav);
}
示例2: artlist
public function artlist()
{
$cid = I('cid', 0, 'int');
if ($cid == 0) {
$this->error('请选择一个分类!', U('Index/index'), false, true, 'Public:404');
}
if ($cid == 'all') {
//$cid=0;
}
$m = D('cate');
$catelist = $m->field('*,CONCAT(spid,id) as path2')->where(array('type' => 1, 'status' => 1))->order('path2')->select();
$t = new tree();
$catelistarr = $t->unlimitCategoryFormat($catelist);
$catehtml = $t->treeFormat($catelistarr);
$this->assign('cid', $cid);
$this->assign('cparent', getcidparent($cid));
$this->assign('webdescription', get_cate_nameByid($cid));
$this->assign('webkeyword', get_cate_nameByid($cid));
$this->assign('webtitle', get_cate_nameByid($cid));
$this->assign('catehtml', $catehtml);
$cateinfo = M('cate')->where(array('id' => $cid))->find();
$cateinfo['path'] = getThumbImageById($cateinfo['img']);
if ($cateinfo['des'] == '') {
//dump($cateinfo['des']==0);
//$cateinfo['des']='暂无介绍';
}
$this->assign('cateinfo', $cateinfo);
$this->display();
}