Index.php 991 Bytes
<?php
/**
 * 默认控制器
 */
use Action\WebAction;

class IndexController extends WebAction
{
    
    /**
     * 男生首页
     */
    public function indexAction()
    {
        if (null !== $this->get('go')) {
            // 先检查COOKIE是否有访问过, 有则跳转到相应的频道页
            \Index\HomeModel::goSwitchChannel();
        } else {
            // 设置客户端浏览器1分钟内不改变 
            $this->setLastModified(mktime(date('H'), date('i'), 0, date('n'), date('j'), date('Y')));
            // 设置浏览器缓存1分钟
            $this->setExpires(60);
        }
        
        $this->setWebNavHeader(\Index\HomeModel::COOKIE_NAME_BOYS);
        $data = array(
            'boysHomePage' => true,
            'boys' => \Index\HomeModel::getChannelResource(\Index\HomeModel::COOKIE_NAME_BOYS, \Index\HomeModel::CODE_BOYS_CHANNEL)
        );
        $this->_view->display('index', $data);
    }
    
}