findModel($id); /** * @var SeoComponent $seo */ $mages = null; $seo = Yii::$app->get('seo'); $seo->setModel($model->language); $images = null; if (!empty($model->gallery)){ $images = Image::find()->where(['id' => Json::decode($model->gallery)])->all(); } return $this->render( 'view', [ 'model' => $model, 'images' => $images ] ); } protected function findModel($id) { /** * @var Page $model * @var SeoComponent $seo */ $seo = \Yii::$app->get('seo'); $model = Page::find() ->where( [ 'id' => $id, ] ) ->with('language') ->one(); if (!empty($model)) { return $model; } else { throw new NotFoundHttpException('Model not found'); } } }