public function actionView($id)
    {
        $model = $this->findModel($id);
        /** @var Answer $query 回答列表 */
        $query = $model->getAnswers()->with('user');

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        return $this->render('view', [
            'model' => $model,
            'dataProvider' => $dataProvider
        ]);
    }
public function actionView($id)
    {
        $model = $this->findModel($id);
        /** @var Answer $query 回答列表 */
        $query = $model->getAnswers()->with('user');

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        return $this->render('view', [
            'model' => $model,
            'dataProvider' => $dataProvider
        ]);
    }
public function actionView ( $ id ) { $ model = $ this -> findModel ( $ id ) ; /** @var Answer $query 回答列表 */ $ query = $ model -> getAnswers ( ) -> with ( 'user' ) ; $ dataProvider = new ActiveDataProvider ( [ 'query' => $ query , ] ) ; return $ this -> render ( 'view' , [ 'model' => $ model , 'dataProvider' => $ dataProvider ] ) ; }
Displays a single Question model.
@param integer $id
@return mixed
Displays a single Question model .