Код: Выделить всё
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
...
[
'class' => 'yii\grid\ActionColumn',
'template' => '{view} {update} {delete} {link}',
'buttons' => [
'update' => function ($url,$model) {
return Html::a(
'<span class="glyphicon glyphicon-screenshot"></span>',
$url);
},
'link' => function ($url,$model,$key) {
return Html::a('Действие', $url);
},
],
],
],
]); ?>
Код: Выделить всё
'buttons' => [
'update' => function ($url,$model) {
return Html::a(
'<span class="glyphicon glyphicon-screenshot"></span>',
$url);
},
'link' => function ($url,$model,$key) {
return Html::a('Действие', $url);
},
],
вообще не понятно что такое анонимная функция , откуда $url откуда $model откуда $key ? может кто нибудь прояснить?