protected function renderContent() { if (isset($this->page)) { $blocks = Yii::app()->cache->get($this->page->page_id . '-' . $this->region); if ($blocks === false) { //var_dump($this->page->page_id.'-'.$this->region); //get all blocks of current region, order by 'order' $blocks = PageBlock::model()->findAll(array('condition' => 'page_id=:paramId and region=:regionId and status=:status', 'params' => array(':paramId' => $this->page->page_id, ':regionId' => $this->region, ':status' => ConstantDefine::PAGE_BLOCK_ACTIVE), 'order' => 'block_order ASC')); if ($blocks) { Yii::app()->cache->set($this->page->page_id . '-' . $this->region, $blocks, 300); $this->workWithBlocks($blocks); } else { echo ''; } } else { $this->workWithBlocks($blocks); } } }