Index.php
1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
use Action\AbstractAction;
use Plugin\Helpers;
use LibModels\Wap\Home\IndexData;
/**
* 频道选择
*/
class IndexController extends AbstractAction
{
/**
* 频道选择页
*/
public function indexAction()
{
if (null !== $this->get('go')) {
// 先检查COOKIE是否有访问过, 有则跳转到相应的频道页
Index\HomeModel::goSwitchChannel();
} else {
// 设置客户端浏览器1小时内不改变,
$this->setLastModified(mktime(date('H'), 0, 0, date('n'), date('j'), date('Y')));
// 设置浏览器缓存5分钟
$this->setExpires(300);
}
$result = Index\HomeModel::getChannel();
$result['background'] = Index\HomeModel::getBgImage();
$result['channelPage'] = true;
$result['showDownloadApp'] = true;
$result['searchUrl'] = Helpers::url('', null, 'search');
$result['pageFooter'] = true;
// 渲染模板
$this->_view->display('index', $result);
}
/**
* 设置升级公告路由
*
*/
public function systemUpdateAction()
{
$this->setTitle('关于系统升级的公告');
$this->_view->display('systemUpdate');
}
}