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


PHP Tree::getIdTreeByModule方法代碼示例

本文整理匯總了PHP中Tree::getIdTreeByModule方法的典型用法代碼示例。如果您正苦於以下問題:PHP Tree::getIdTreeByModule方法的具體用法?PHP Tree::getIdTreeByModule怎麽用?PHP Tree::getIdTreeByModule使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Tree的用法示例。


在下文中一共展示了Tree::getIdTreeByModule方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getRSS

 public static function getRSS()
 {
     $data = array();
     $id = Tree::getIdTreeByModule('news');
     $sql = 'SELECT * FROM {{tree}} WHERE parent=' . $id . ' AND visible=1 ORDER BY udate DESC LIMIT 0,10';
     $list = DB::getAll($sql);
     foreach ($list as $item) {
         $field = Fields::getFieldsByTree($item['id']);
         $data[] = array('id' => $item['id'], 'name' => trim(strip_tags($item['name'])), 'preview' => strip_tags($field['preview']), 'path' => 'http:://' . $_SERVER['HTTP_HOST'] . '/about/news/' . $item['id'] . '/', 'udate' => date("D, d M Y H:i:s O", strtotime($item['udate'])));
     }
     return array('list' => $data);
 }
開發者ID:sov-20-07,項目名稱:billing,代碼行數:12,代碼來源:ArticlesModel.php

示例2: ask

 function ask()
 {
     if ($_POST) {
         $tree = Tree::getIdTreeByModule('faq');
         $model = new Faq();
         if ($model->ask($tree) === true) {
             $this->redirect('/faq/thanks/');
             View::render('faq/ask', $tree);
         }
     } else {
         $tree = Tree::getTreeByUrl('wide');
         Funcs::setMeta($tree);
         $tree['rubrics'] = Faq::getRubricsTree($tree['parent']);
         View::render('faq/ask', $tree);
     }
 }
開發者ID:sov-20-07,項目名稱:billing,代碼行數:16,代碼來源:FaqController.php

示例3: getRubricsTree

    public function getRubricsTree($tree)
    {
        $data = array();
        $parent = Tree::getIdTreeByModule('faq');
        $sql = '
			SELECT * FROM {{tree}}
			WHERE parent=' . $parent . ' AND visible=1 AND path<>\'ask\' AND path<>\'thanks\'
			ORDER BY num
		';
        $list = DB::getAll($sql);
        foreach ($list as $item) {
            $countAll = 0;
            if (Funcs::$uri[1] == '' || Funcs::$uri[1] == 'ask' || Funcs::$uri[1] != '' && $tree == $item['id'] && Funcs::$uri[1] != 'ask') {
                $items = Faq::getRecurs($item['id']);
                $data[] = array('id' => $item['id'], 'name' => $item['name'], 'path' => $item['path'], 'sub' => $items['sub'], 'count' => $countAll);
            }
        }
        return $data;
    }
開發者ID:sov-20-07,項目名稱:billing,代碼行數:19,代碼來源:FeedbackModel.php

示例4: run

 function run()
 {
     $id = Tree::getIdTreeByModule('news');
     $list = News::getList($id, 5);
     View::widget('news', array('list' => $list));
 }
開發者ID:sov-20-07,項目名稱:billing,代碼行數:6,代碼來源:NewsWidget.php


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