BlockRenderWidget::setRenderOutput PHP Method

setRenderOutput() public static method

public static setRenderOutput ( $obj )
    public static function setRenderOutput($obj)
    {
        // We will render the layout based on the
        // layout
        $name = strpos($obj->id, '.') === false ? $obj->id : substr($obj->id, strrpos($obj->id, '.') + 1);
        $render = 'common.front_blocks.' . $obj->id . '.' . $name . '_block_output';
        /*Delete for optimize		if(file_exists(Yii::getPathOfAlias('common.front_layouts.'.$obj->page->layout.'.blocks').'/'.$obj->id.'_block_output.php')){                
                       $render='common.front_layouts.'.$obj->page->layout.'.blocks.'.$obj->id.'_block_output';                
                   }
                   
        		Delete for optimize */
        return $render;
    }

Usage Example

 protected function renderContent()
 {
     if (isset($this->block) && $this->block != null) {
         //Set Params from Block Params
         $params = unserialize($this->block->params);
         $this->setParams($params);
         $post_id = (int) $_GET['id'];
         if ($post_id) {
             $post = Object::model()->findByPk($post_id);
             if ($post) {
                 Yii::app()->controller->pageTitle = CHtml::encode($post->object_name);
                 Yii::app()->controller->description = CHtml::encode($post->object_description);
                 Yii::app()->controller->keywords = CHtml::encode($post->object_keywords);
                 Yii::app()->controller->change_title = true;
                 $this->render(BlockRenderWidget::setRenderOutput($this), array('post' => $post));
             } else {
                 throw new CHttpException('404', t('Page not found'));
             }
         } else {
             throw new CHttpException('404', t('Page not found'));
         }
     } else {
         echo '';
     }
 }
All Usage Examples Of BlockRenderWidget::setRenderOutput