controllers/MainController.php
public function actionView($id, $renderPartial = false)
    {
        $modelNews = $this->module->model('News');
        $model = $modelNews::findOne($id);

        $modelI18n = false;
        if (!empty($model)) {
            $modelsI18n = $modelNews::prepareI18nModels($model);
            $modelI18n = $modelsI18n[$this->langCodeMain];
        }

        $searchModel = $this->module->model('NewsSearchFront');
        if ($renderPartial) {
            $model = $searchModel::canShow($model, $modelI18n, $ignoreVisibility = true);
        } else {
            $model = $searchModel::canShow($model, $modelI18n);
        }
        if (!$model) {
            $modelI18n = false;
        }

        if ($renderPartial) {
            return $this->renderPartial('view', compact('model', 'modelI18n'));
        } else {
            return $this->render('view', compact('model', 'modelI18n'));
        }
    }
public function actionView($id, $renderPartial = false)
    {
        $modelNews = $this->module->model('News');
        $model = $modelNews::findOne($id);

        $modelI18n = false;
        if (!empty($model)) {
            $modelsI18n = $modelNews::prepareI18nModels($model);
            $modelI18n = $modelsI18n[$this->langCodeMain];
        }

        $searchModel = $this->module->model('NewsSearchFront');
        if ($renderPartial) {
            $model = $searchModel::canShow($model, $modelI18n, $ignoreVisibility = true);
        } else {
            $model = $searchModel::canShow($model, $modelI18n);
        }
        if (!$model) {
            $modelI18n = false;
        }

        if ($renderPartial) {
            return $this->renderPartial('view', compact('model', 'modelI18n'));
        } else {
            return $this->render('view', compact('model', 'modelI18n'));
        }
    }
public function actionView ( $ id , $ renderPartial = false ) { $ modelNews = $ this -> module -> model ( 'News' ) ; $ model = $ modelNews :: findOne ( $ id ) ; $ modelI18n = false ; if ( ! empty ( $ model ) ) { $ modelsI18n = $ modelNews :: prepareI18nModels ( $ model ) ; $ modelI18n = $ modelsI18n [ $ this -> langCodeMain ] ; } $ searchModel = $ this -> module -> model ( 'NewsSearchFront' ) ; if ( $ renderPartial ) { $ model = $ searchModel :: canShow ( $ model , $ modelI18n , $ ignoreVisibility = true ) ; } else { $ model = $ searchModel :: canShow ( $ model , $ modelI18n ) ; } if ( ! $ model ) { $ modelI18n = false ; } if ( $ renderPartial ) { return $ this -> renderPartial ( 'view' , compact ( 'model' , 'modelI18n' ) ) ; } else { return $ this -> render ( 'view' , compact ( 'model' , 'modelI18n' ) ) ; } }
Render article's body.
@param integer $id
@param boolean $renderPartial if true ignore visibility and show without layout by call renderPartial()
Render article s body .