本文整理汇总了PHP中Catalog::getViewed方法的典型用法代码示例。如果您正苦于以下问题:PHP Catalog::getViewed方法的具体用法?PHP Catalog::getViewed怎么用?PHP Catalog::getViewed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Catalog
的用法示例。
在下文中一共展示了Catalog::getViewed方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct()
{
if (Funcs::$uri[0] == '') {
$tree = Tree::getTreeByUrl('wide');
Funcs::setMeta($tree);
//$tree['hits']=Index::getHits();
//$tree['mainbanner']=Index::getMainBanner();
//$id=Tree::getIdTreeByModule('news');
//$tree['news']=News::getList($id,2);
//$tree['banners']=Index::getBanners();
/*$tree['about']=Fields::getFieldsByTree(8,'wide');
$tree['examples']=Index::getExamples();
$tree['forum']=Forum::getIndex();*/
View::render('site/index', $tree);
} elseif (Funcs::$uri[0] == 'sitemap') {
//$tree=Tree::getTreeByUrl('wide');
//Funcs::setMeta($tree);
$model = new Tree();
$tree['sitemap'] = $model->getSitemap();
View::render('site/sitemap', $tree);
} elseif (Funcs::$uri[0] == 'rss') {
View::$layout = "empty";
View::render('news/rss', News::getRSS());
} elseif (Funcs::$uri[0] == 'contacts' && Funcs::$uri[1] == '') {
$tree = Tree::getTreeByUrl('wide');
Funcs::setMeta($tree);
View::render('site/contacts', $tree);
} elseif (Funcs::$uri[0] == 'viewed') {
$tree = Tree::getTreeByUrl('wide');
Funcs::setMeta($tree);
$tree['list'] = Catalog::getViewed();
$tree['recommended'] = Catalog::getRecommended();
View::render('favorite/viewed', $tree);
} elseif (Funcs::$uri[0] == 'customer' && Funcs::$uri[1] == 'partners' && Funcs::$uri[2] == 'anketa' && Funcs::$uri[3] == '') {
$tree = Tree::getTreeByUrl('wide');
Funcs::setMeta($tree);
View::render('site/anketa', $tree);
} else {
$tree = Tree::getTreeByUrl();
Funcs::setMeta($tree);
if ($tree['info']['type'] == 'spage') {
$class = strtoupper(substr($tree['info']['path'], 0, 1)) . substr($tree['info']['path'], 1, strlen($tree['info']['path']));
if (class_exists($class)) {
if ($tree['info']['id2'] == 0) {
eval('$tree[\'list\']=' . $class . '::getList($tree[\'id\']);');
View::render($tree['info']['path'] . '/list', $tree);
} else {
eval('$tree[\'fields\']=' . $class . '::getOne($tree[\'id\']);');
if (isset($_GET['print'])) {
View::$layout = 'empty';
View::render($tree['info']['path'] . '/print', $tree);
} else {
View::render($tree['info']['path'] . '/one', $tree);
}
}
} else {
if ($tree['info']['id2'] == 0) {
$tree['list'] = Spage::getList($tree['id']);
View::render($tree['info']['path'] . '/list', $tree);
} else {
$tree['fields'] = Spage::getOne($tree['id']);
if (isset($_GET['print'])) {
View::$layout = 'empty';
View::render($tree['info']['path'] . '/print', $tree);
} else {
View::render($tree['info']['path'] . '/one', $tree);
}
}
}
} else {
View::render('site/page', $tree);
}
}
}
示例2: hor
function hor()
{
$data['viewed'] = Catalog::getViewed();
//$data['favorite']=Catalog::getFavorite();
View::widget('panel/hor', $data);
}