/** * @expectedException \yii\web\NotFoundHttpException */ public function testGetPublishedPostFail() { $this->postModel->getPost(1); }
/** * Просмотр поста. * @param string $id идентификатор поста * @return string */ public function actionView($id) { $post = new Post(); return $this->render('view', ['model' => $post->getPost($id), 'commentForm' => new CommentForm(Url::to(['comment/add', 'id' => $id]))]); }
public function actionView($id) { $post = new Post(); return $this->render('view', ['model' => $post->getPost($id)]); }