I have this code:
$dataProvider,
\'filterModel\' => $searchModel,
\'columns\' => [
[\
solution:
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
[
'label'=>'bla',
'format' => 'raw',
'value'=>function ($data) {
return Html::a(['site/index']);
},
],
['class' => 'yii\grid\ActionColumn'],
],
]); ?>
try this one if you need to make the attribute as label :
[
'label'=>'' ,
'header'=>Yii::t('app', 'Sample Number'),
'attribute'=>'sample_number',
'width'=>'310px',
'value' => function ($model) {
return Html::a(Html::encode( $model->sample_number),
Url::to(['controller/action', 'sample_number' => $model->sample_number]));
},
'format' => 'raw',
'options'=>['class'=>'success','style'=>'font-weight:bold;'],
],