title = 'Ответы пользователей'; $this->params['breadcrumbs'][] = $this->title; ?>
= Html::a('Создать новый ответ пользователя', ['create'], ['class' => 'btn btn-success']) ?>
= GridView::widget([ 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [ ['class' => 'yii\grid\SerialColumn'], [ 'attribute' => 'user_questionnaire_id', 'filter' => Questionnaire::find()->select(['title', 'id'])->indexBy('id')->column(), 'value' => function($model){ return $model->getQuestionnaireTitle(); } ], [ 'attribute' => 'user_id', 'filter' => User::find()->select(['username', 'id'])->indexBy('id')->column(), 'value' => 'user.username', ], [ 'attribute' => 'question_id', 'value' => 'question.question_body', ], 'response_body', [ 'attribute' => 'Тип вопроса', 'value' => function($model){ return $model->getQuestionType(); } ], [ 'attribute' => 'answer_flag', 'filter' => AnswerHelper::answerFlagsList(), 'format' => 'raw', 'value' => function ($model) { return AnswerHelper::answerFlagLable($model->answer_flag); }, ], ['class' => 'yii\grid\ActionColumn'], ], ]); ?>