Example #1
0
 /**
  * Просмотр поста.
  * @param string $id идентификатор поста
  * @return string
  */
 public function actionView($id)
 {
     $model = new Post();
     // Получаем пост
     $post = $model->getPost($id);
     return $this->render('view', ['post' => $post, 'modelComments' => new PostComment()]);
 }
Example #2
0
 /**
  * @param $id
  * @return Post
  * @throws \yii\web\NotFoundHttpException
  */
 public function getModelMaterial($id)
 {
     $model = new Post();
     $post = $model->getPost($id);
     return $post;
 }