URL in yii2 gridview

برنامه نویسی php
برای نمایش لینک در gridview :

GridView::widget([
  'dataProvider' => $dataProvider,
  'filterModel' => $searchModel,
  'columns' => [
    ['class' => 'yii\grid\SerialColumn'],
    [
           'label'=>'bla',
           'format' => 'raw',
       'value'=>function ($data) {
            return Html::url('site/index');
        },
    ],
    ['class' => 'yii\grid\ActionColumn'],
],
]);

Leave a Reply

Your email address will not be published. Required fields are marked *