当前位置: 首页>>代码示例>>PHP>>正文


PHP Tree::get_tree_array方法代码示例

本文整理汇总了PHP中Tree::get_tree_array方法的典型用法代码示例。如果您正苦于以下问题:PHP Tree::get_tree_array方法的具体用法?PHP Tree::get_tree_array怎么用?PHP Tree::get_tree_array使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tree的用法示例。


在下文中一共展示了Tree::get_tree_array方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: info

 public function info()
 {
     $infoid = I('get.infoid');
     $this->assign('infoid', $infoid);
     //获取车型列表
     $info_db = D('Info');
     $infoList = $info_db->getInfoList();
     $this->assign('infoList', $infoList);
     //题图
     $topPicList = getPicMetaArr($infoid, 91);
     //print_r($topPicList);exit;
     $this->assign('topPicList', $topPicList);
     $classself_db = D('ClassSelf');
     $data_class = array();
     $data_class = $classself_db->getClassSelfList($infoid);
     foreach ($data_class as $key => &$row) {
         if ($row['classid'] == 91) {
             unset($data_class[$key]);
         }
         if ($row['parentid'] == 91) {
             unset($data_class[$key]);
         }
         $row['cid'] = $row['id'];
         $row['id'] = $row['classid'];
     }
     $tree = new \Tree();
     $tree->init($data_class);
     $menuList = $tree->get_tree_array(0);
     $this->assign('menuList', $menuList);
     $this->display(":info");
 }
开发者ID:shizitao,项目名称:iucars,代码行数:31,代码来源:InfoController.class.php

示例2: sp_get_menu_tree

function sp_get_menu_tree($id = "main")
{
    $navs = F("site_nav_" . $id);
    if (empty($navs)) {
        $navs = _sp_get_menu_datas($id);
    }
    import("Tree");
    $tree = new \Tree();
    $tree->init($navs);
    return $tree->get_tree_array(0, "");
}
开发者ID:noikiy,项目名称:luokeke2,代码行数:11,代码来源:function.php

示例3: index

 public function index()
 {
     //首页职业分类表最大度81个字节start_1
     import("Tree");
     $tree = new \Tree();
     $result = $this->category_model->where('progenitor = 9130971')->select();
     foreach ($result as $r) {
         $array[] = $r;
     }
     $tree->init($array);
     $str = '';
     $select_categorys = $tree->get_tree_array(0);
     $classnums = 1;
     if ($classnums <= 9) {
         foreach ($select_categorys[1]['child'] as $v) {
             $str .= '<div class="cd' . $classnums . '">';
             $str .= '<div class="cd' . $classnums . '_1">' . $v['name'] . '</div>';
             $vv_strlen_all = '';
             foreach ($v['child'] as $vv) {
                 $vv_strlen = strlen($vv['name']);
                 $vv_strlen_all += $vv_strlen;
                 if ($vv_strlen_all > 85) {
                 } else {
                     if ($vv_strlen >= 16) {
                         $str .= '<div class="cd1_3"><a href="' . U('portal/index/list_recruit', array('category' => $vv['id'])) . '">' . $vv['name'] . '</a></div>';
                     } else {
                         $str .= '<div class="cd1_2"><a href="' . U('portal/index/list_recruit', array('category' => $vv['id'])) . '">' . $vv['name'] . '</a></div>';
                     }
                 }
             }
             unset($vv_strlen_all);
             $str .= '</div>';
             $classnums++;
         }
     }
     $this->assign("str_posts", $str);
     //end_1
     //企业标签start_2
     $user_posts = $this->users_model->where('user_type = 3')->order('create_time desc')->limit(8)->select();
     foreach ($user_posts as &$v) {
         $v['position_cg'] = array();
         $v_recruit = $this->recruit_model->where('user_id =' . $v['id'] . ' and status = 1')->select();
         $i = 0;
         foreach ($v_recruit as $k => &$vv) {
             $v['position_cg'][] = $this->get_category_name($vv['position_cg']);
             if ($i <= 3) {
                 $v['recruittitle'][$i]['title'] = $vv['title'];
                 $v['recruittitle'][$i]['id'] = $vv['id'];
             }
             $v['recruit_nums'] = $k + 1;
             $i++;
         }
     }
     $this->assign('user_posts', $user_posts);
     //end_2
     //挂证start_3
     $certificate_posts = $this->lookcertificate_model->where('status = 1')->order('created_at desc')->limit(4)->select();
     foreach ($certificate_posts as &$v) {
         $v['user'] = $this->users_model->field(array('user_nicename', 'thumb'))->where('id=' . $v['user_id'])->find();
     }
     $this->assign('certificate_posts', $certificate_posts);
     //end_3
     $certificate_results = $this->certificate_model->limit(16)->select();
     foreach ($certificate_results as &$v) {
         $v['updated_at'] = $this->get_timediff($v['updated_at']);
         $v['position_cg'] = $this->get_category_name($v['position_cg']);
     }
     $this->assign('certificate_results', $certificate_results);
     $this->display(":index");
 }
开发者ID:wjazz3911,项目名称:jcjy,代码行数:70,代码来源:IndexController.class.php


注:本文中的Tree::get_tree_array方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。