Пример #1
0
 /**
  * Displays a single Thread model.
  * @param integer $id
  * @return mixed
  */
 public function actionView($id)
 {
     $thread = $this->findModel($id);
     $thread->updateCounters(['views' => 1]);
     $query = Post::find()->where(['thread_id' => $thread['id']]);
     $locals = YiiForum::getPagedRows($query, ['order' => 'create_time asc', 'pageSize' => 10]);
     $locals['currentBoard'] = $this->getBoard($thread['board_id']);
     $locals['thread'] = $thread;
     $locals['newPost'] = new Post();
     return $this->render('view', $locals);
 }
 /**
  * Lists all User models.
  *
  * @return mixed
  */
 public function actionIndex()
 {
     $query = User::find();
     $locals = YiiForum::getPagedRows($query);
     return $this->render('index', $locals);
 }