public function init() { parent::init(); import('util/system/Type'); $this->_type = Util_System_Type::getNewsType(); $this->_gameTypes = Util_System_Type::getGameType(); $this->assign('type', $this->_type); $this->assign('gameType', $this->_gameTypes); $this->assign('isTop', $this->_isTop); }
public function init() { parent::init(); $this->_modelGames = $this->getGlobal('model/Games', 'Model_Games'); $this->_games = $this->_modelGames->getAll(); //所有游戏 import('util/system/Type'); $this->_status = Util_System_Type::getServersStatus(); $this->_payStatus = Util_System_Type::getServersPayStatus(); $this->assign('games', $this->_games); }
} private function checkPage($page) { if (!preg_match('/^[a-z0-9-]+$/i', $page)) { throw new NotFoundException('Unsafe page "' . $page . '" requested'); } if (!$this->hasScript($page) && !$this->hasTemplate($page)) { throw new NotFoundException('Page "' . $page . '" not found'); } return $page; } private function hasScript($page) { return file_exists($this->getScript($page)); } private function hasTemplate($page) { return file_exists($this->getTemplate($page)); } private function getScript($page) { return self::PAGE_DIR . $page . '-script.php'; } private function getTemplate($page) { return self::PAGE_DIR . $page . '-view.php'; } } $index = new Index(); $index->init(); $index->run();