Rename GridView Header without disabling sorting

I’ve got multiple views using the same table, except that they are filtered, which means I can’t change it through the model label. I tried renaming the header to rename the display, however, it disabled the sorting ability. How do I rename the header without disabling the sorting?


<?= GridView::widget([

        'dataProvider' => $dataProvider,

        'columns' => [

            ['class' => 'yii\grid\SerialColumn'],


			[

				'header' => 'Description',

				'attribute' => 'column_c',

				'format' => 'text',

			],

			[

				'header' => 'Days',

				'attribute' => 'column_d',

				'format' => 'text',

			],


            ['class' => 'yii\grid\ActionColumn'],

        ],

    ]); ?>

Hi,

You could use "label" instead of "header" like described here:

http://www.yiiframework.com/doc-2.0/yii-grid-gridview.html#$columns-detail




[

  'label' => 'Description',

  'attribute' => 'column_c',

  'format' => 'text',

],



Regards

Wow, thanks! I didn’t know that. Just curious though, what’s the difference with label and header, why should there be two separate way to rename an attribute label?