本文整理匯總了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);
}
示例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);
}
}
示例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;
}
示例4: run
function run()
{
$id = Tree::getIdTreeByModule('news');
$list = News::getList($id, 5);
View::widget('news', array('list' => $list));
}