<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
...
[
'class' => 'yii\grid\ActionColumn',
'template' => '{view} {update} {mydelete}',
'buttons' => [
'mydelete' => function ($url,$model) {
return Html::a(
'удаляшка',
['/controller/delete', 'id'=>$model->id, 'second_hren'=>'hihichpock']);
},
],
],
],
]); ?>
public function beforeSave($insert)
{
if (parent::beforeSave($insert)) {
//тут ваш код, например
//$this->realtor_id = yii\helpers\Json::encode($this->realtor_id);
return true;
} else {
return false;
}
}
public function afterFind()
{
$this->realtor_id = yii\helpers\Json::decode($this->realtor_id);
}
радио кнопок