Answer the question
In order to leave comments, you need to log in
How to add yii2 HTML tags to GridView header?
I want to add tags to the heading 'label' => tex . 'tags',
[
'label' => $data->subject . '<i class="material-icons">swap_vert</i>',
'attribute' => 'subject',
'format' => 'raw',
'value' => function ($data) {
return Html::a($data->subject, Url::to(['report/view', 'id' => $data->id]));
},
'filterInputOptions' => ['class' => 'form-control form-control-sm'],
],
Answer the question
In order to leave comments, you need to log in
Good afternoon.
Use encodeLabel so you can add the tag.
[
'label' => $data->subject . '<i class="material-icons">swap_vert</i>',
'encodeLabel' => false,
'attribute' => 'subject',
'format' => 'raw',
'value' => function ($data) {
return Html::a($data->subject, Url::to(['report/view', 'id' => $data->id]));
},
'filterInputOptions' => ['class' => 'form-control form-control-sm'],
],
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question