當前位置: 首頁>>代碼示例>>PHP>>正文


PHP tree::treeFormat方法代碼示例

本文整理匯總了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);
 }
開發者ID:Willshon,項目名稱:OLCS,代碼行數:55,代碼來源:HomeController.class.php

示例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();
 }
開發者ID:Willshon,項目名稱:OLCS,代碼行數:29,代碼來源:IndexController.class.php


注:本文中的tree::treeFormat方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。