本文整理汇总了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));
}