📄 正在查看:twcms/control/cate_control.class.php
大小:1,146 字节 · 修改:2014-01-23 01:42:52 · 行数:40
1<?php
2/**
3 * (C)2012-2014 twcms.com TongWang Inc.
4 * Author: wuzhaohuan <kongphp@gmail.com>
5 */
6
7defined('TWCMS_PATH') or exit;
8
9class cate_control extends control{
10 public $_cfg = array(); // 全站参数
11 public $_var = array(); // 分类页参数
12
13 public function index() {
14 // hook cate_control_index_before.php
15
16 $_GET['cid'] = (int)R('cid');
17 $this->_var = $this->category->get_cache($_GET['cid']);
18 empty($this->_var) && core::error404();
19
20 $this->_cfg = $this->runtime->xget();
21
22 // SEO 相关
23 $this->_cfg['titles'] = $this->_var['name'].(empty($this->_var['seo_title']) ? '' : '/'.$this->_var['seo_title']);
24 !empty($this->_var['seo_keywords']) && $this->_cfg['seo_keywords'] = $this->_var['seo_keywords'];
25 !empty($this->_var['seo_description']) && $this->_cfg['seo_description'] = $this->_var['seo_description'];
26
27 $this->assign('tw', $this->_cfg);
28 $this->assign('tw_var', $this->_var);
29
30 $GLOBALS['run'] = &$this;
31
32 // hook cate_control_index_after.php
33
34 $_ENV['_theme'] = &$this->_cfg['theme'];
35 $this->display($this->_var['cate_tpl']);
36 }
37
38 // hook cate_control_after.php
39}
40