Showing
1 changed file
with
32 additions
and
32 deletions
1 | -<?php | ||
2 | -/** | ||
3 | - * 默认控制器 | ||
4 | - */ | ||
5 | -use Action\WebAction; | ||
6 | - | ||
7 | -class IndexController extends WebAction | ||
8 | -{ | ||
9 | - | ||
10 | - /** | ||
11 | - * 男生首页 | ||
12 | - */ | ||
13 | - public function indexAction() | ||
14 | - { | ||
15 | - if (null !== $this->get('go')) { | ||
16 | - // 先检查COOKIE是否有访问过, 有则跳转到相应的频道页 | ||
17 | - \Index\HomeModel::goSwitchChannel(); | ||
18 | - } else { | ||
19 | - // 设置客户端浏览器1分钟内不改变 | ||
20 | - $this->setLastModified(mktime(date('H'), date('i'), 0, date('n'), date('j'), date('Y'))); | ||
21 | - // 设置浏览器缓存1分钟 | ||
22 | - $this->setExpires(60); | ||
23 | - } | ||
24 | - | ||
25 | - $this->setWebNavHeader(\Index\HomeModel::COOKIE_NAME_BOYS); | ||
26 | - $data = array( | ||
27 | - 'boysHomePage' => true, | ||
28 | - 'boys' => \Index\HomeModel::getChannelResource(\Index\HomeModel::COOKIE_NAME_BOYS, \Index\HomeModel::CODE_BOYS_CHANNEL) | ||
29 | - ); | ||
30 | - $this->_view->display('index', $data); | ||
31 | - } | ||
32 | - | 1 | +<?php |
2 | +/** | ||
3 | + * 默认控制器 | ||
4 | + */ | ||
5 | +use Action\WebAction; | ||
6 | + | ||
7 | +class IndexController extends WebAction | ||
8 | +{ | ||
9 | + | ||
10 | + /** | ||
11 | + * 男生首页 | ||
12 | + */ | ||
13 | + public function indexAction() | ||
14 | + { | ||
15 | + if (null !== $this->get('go')) { | ||
16 | + // 先检查COOKIE是否有访问过, 有则跳转到相应的频道页 | ||
17 | + \Index\HomeModel::goSwitchChannel(); | ||
18 | + } else { | ||
19 | + // 设置客户端浏览器1分钟内不改变 | ||
20 | + $this->setLastModified(mktime(date('H'), date('i'), 0, date('n'), date('j'), date('Y'))); | ||
21 | + // 设置浏览器缓存1分钟 | ||
22 | + $this->setExpires(60); | ||
23 | + } | ||
24 | + | ||
25 | + $this->setWebNavHeader(\Index\HomeModel::COOKIE_NAME_BOYS); | ||
26 | + $data = array( | ||
27 | + 'boysHomePage' => true, | ||
28 | + 'boys' => \Index\HomeModel::getChannelResource(\Index\HomeModel::COOKIE_NAME_BOYS, \Index\HomeModel::CODE_BOYS_CHANNEL) | ||
29 | + ); | ||
30 | + $this->_view->display('../boys/index', $data); | ||
31 | + } | ||
32 | + | ||
33 | } | 33 | } |
-
Please register or login to post a comment