public function actionDetail() { $id = Yii::$app->request->get('id'); $article = new Article(); $detail = $article->getDetail($id); $comment = new Comment(); $comments = $comment->getComments($id); $visitor = new Visitor(); echo $this->render('detail', ['detail' => $detail, 'comments' => $comments, 'visitor' => $visitor]); }