public function actionContent($id)
 {
     $backUrl = \Yii::$app->request->referrer;
     $content = ContentRecord::findOne($id);
     $this->layout = 'basic-content';
     return $this->render('content', compact('content', 'backUrl'));
 }
Exemple #2
0
 public function init()
 {
     parent::init();
     if ($this->pageId) {
         $this->_item = ContentRecord::findOne($this->pageId);
     } else {
         throw new InvalidConfigException(\Yii::t('front', 'No required parameter given') . ' - pageId');
     }
     if (!$this->viewName) {
         throw new InvalidConfigException(\Yii::t('front', 'No required parameter given') . ' - viewName');
     }
 }