Article::find() ->where( [ 'status' => true, ] ) ->orderBy("sort"), 'pagination' => [ 'pageSize' => 5, ], ] ); return $this->render( 'index', [ 'dataProvider' => $dataProvider, ] ); } public function actionArticle($id) { $model = $this->findModel($id); return $this->render( 'view', [ 'article' => $model, ] ); } protected function findModel($id) { /** * Some comment */ $model = Article::find() ->where( [ 'id' => $id ] ) ->with("lang") ->one(); if ( $model !== NULL) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } } }