<?php
$this->widget('zii.widgets.grid.CGridView', array(
'id' => 'grant-approval-child',
'dataProvider'=>$grantRequestItems,
'ajaxUpdate' => true,
'enableSorting' => true,
'emptyText' => ' ',
'itemsCssClass' => 'table table-hover table-grant-approval',
'columns'=>array(
[
'header'=>'Last Update',
'name' => 'requestLastUpdated',
'value'=>'$data["requestLastUpdated"]',
],
[
'name' => 'status',
'header' => 'Approval Status and Chat',
'headerHtmlOptions' => ['class' => 'text-center'],
'type' => 'raw',
'value' => function($data) {
return "<span>" . (($data['approval'] == 1)? "Approved" : "Pending Your Approval") . "</span></br> <span class='glyphicon glyphicon-comment show-chat' data-entity-id='" . $data['requestId'] . "' data-entity-type='grant'></span>";
},
'htmlOptions' => ['class' => 'text-center'],
],
[
'header'=>'Submitted by*',
'name' => 'fullName',
'value'=>'$data["fullName"]',
],
[
'header'=>'Associated Campus',
'name' => 'campus',
'value'=>'$data["campus"]',
],
[
'header'=>CHtml::encode($data["question_1"]["question_response"]),
'name' => 'question_1',
'type' => 'raw',
'value'=> function($data) {
return "<div>" . $data["question_1"]["question_response"] . "</div>";
}
],
[
'header'=>'123',
'name' => 'question_2',
'type' => 'raw',
'value'=> function($data) {
return "<div>" . $data["question_2"]["question_response"] . "</div>";
}
],
[
'header'=>'$q1',
'name' => 'question_3',
'type' => 'raw',
'value'=> function($data) {
return "<div>" . $data["question_3"]["question_response"] . "</div>";
}
],
[
'header'=>'$q1',
'name' => 'question_4',
'type' => 'raw',
'value'=> function($data) {
return "<div>" . $data["question_4"]["question_response"] . "</div>";
}
],
[
'header'=>'$q1',
'name' => 'question_5',
'type' => 'raw',
'value'=> function($data) {
return "<div>" . $data["question_5"]["question_response"] . "</div>";
}
],
),
));
This is my code and i need my header to have the value $data[“question_no”][“question”] but it doesnt work if i directly put it to header. I am pretty new to Yii… so what can be done?