/**
* 话题详细页
* @param integer $id
* @return mixed
*/
public function actionView($id)
{
$model = Topic::findTopic($id);
$dataProvider = new ActiveDataProvider(['query' => PostComment::findCommentList($id), 'pagination' => ['pageSize' => self::PAGE_SIZE]]);
// 文章浏览次数
Topic::updateAllCounters(['view_count' => 1], ['id' => $id]);
$user = Yii::$app->user->identity;
$admin = $user && ($user->isAdmin($user->username) || $user->isSuperAdmin($user->username)) ? true : false;
return $this->render('view', ['model' => $model, 'dataProvider' => $dataProvider, 'comment' => new PostComment(), 'admin' => $admin]);
}