Пример #1
0
 /**
  * @expectedException \yii\web\NotFoundHttpException
  */
 public function testGetPublishedPostFail()
 {
     $this->postModel->getPost(1);
 }
Пример #2
0
 /**
  * Просмотр поста.
  * @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]))]);
 }
Пример #3
0
 public function actionView($id)
 {
     $post = new Post();
     return $this->render('view', ['model' => $post->getPost($id)]);
 }