public function indexAction()
 {
     //set cache
     $this->_request->setParam('cache_file', 1);
     $strCateCode = $this->_request->getParam('controller');
     //get instance Cate
     $objCate = Thethao_Model_Category::getInstance();
     // Get models instance
     $modelBlock = new Thethao_Model_Block();
     $arrParams = array('key_id' => 'trungthuong_worldcup2014');
     $arrListWinner = $modelBlock->getKeyBox($arrParams);
     $this->view->assign(array('arrListWinner' => $arrListWinner, 'strCateCode' => $strCateCode));
     //gan meta data
     $titleMeta = 'Danh sách trúng thưởng World Cup 2014 - VnExpress';
     $keywords = 'World cup 2014, tin tuc , bong da';
     $description = '';
     //Set param
     $this->_request->setParam('block_cate', WORLD_CUP);
     //set cateid to show active in menu
     $this->_request->setParam('cateid', WORLD_CUP);
     //Add script
     $this->view->headTitle($titleMeta);
     $this->view->headMeta()->setName('description', $description);
     $this->view->headMeta()->setName('keywords', $keywords);
 }
 /**
  * Widget hot news
  */
 public function indexAction()
 {
     //disable layout
     $this->_helper->layout->disableLayout();
     //set cache
     $this->_request->setParam('cache_file', 1);
     //Get article id
     $arrParam = $this->_request->getParams();
     switch ($arrParam['type']) {
         case 3:
             $keyId = 'schedule_seagames28_vn';
             break;
         case 2:
             $keyId = 'bxh_seagames_28_vn';
             break;
         case 1:
         default:
             $keyId = 'bxh_seagames_28';
             break;
     }
     //get Instance News
     $modelBlock = new Thethao_Model_Block();
     //get data with rule 1
     $arrData = $modelBlock->getKeyBox(array('key_id' => $keyId));
     //check type
     $intType = 1;
     if (isset($arrParam['type'])) {
         $intType = $arrParam['type'] > 3 ? 1 : $arrParam['type'];
     }
     $this->view->assign(array('arrData' => $arrData, 'type' => $intType));
 }
 /**
  * @author      : HungNT
  * call job clear cache keybox fe
  * @todo        : clearCacheKeybox
  * @param type $arrParams
  */
 public function clearCacheKeybox($params)
 {
     // Delete cache
     $keyCache = Thethao_Global::makeCacheKey($params['key_id']);
     if (!$keyCache) {
         $keyCache = $params['key_id'];
     }
     Thethao_Global::deleteMemcache(array($keyCache));
     // Get player model
     $model = new Thethao_Model_Block();
     $arrReturn = $model->getKeyBox($params);
     //init news instance
     $caching = Thethao_Model_Caching::getInstance();
     $caching->clearCacheFile();
     //return
     return $arrReturn;
 }
Esempio n. 4
0
 /**
  * @author   : PhongTX - 20/06/2013
  * call job update caching FE
  * @param : string $strPageCode
  * @name : updateCache
  * @copyright   : FPT Online
  * @todo    : updateCache
  */
 public function updateBlock($arrParams)
 {
     try {
         //default response
         $return = array('update_block' => 0);
         //new instance object
         $modelBlock = new Thethao_Model_Block();
         $arrPageCode = $arrParams['strPageCode'];
         $response = array();
         if (!empty($arrPageCode)) {
             foreach ($arrPageCode as $pageCode) {
                 $response[] = $modelBlock->updateBlock($pageCode);
             }
             self::clearApcFile();
         }
         $return['update_block'] = $response;
     } catch (Exception $ex) {
         //log error
         Thethao_Global::sendLog($ex);
     }
     return $return;
 }