I'm getting some data using a webservice which is in JSON format and want to dispaly them using gridview. I use ArrayDataProvider to send data to the gridview using this code:
$dataProvider = new ArrayDataProvider([
'allModels' => $data,
'pagination' => [
'pageSize' => 10,
],
'sort' => [
'attributes' => ['fname', 'lname', 'age', 'email'],
],
]);
How can I change label of columns in grid? For example First Name instead of fname?
Thank you.
In gridview you can change the label atribute
http://www.yiiframework.com/doc-2.0/yii-grid-datacolumn.html
http://www.yiiframework.com/doc-2.0/yii-grid-datacolumn.html#$label-detail