–> form
<?= $form->field($model, 'DIVISI_ID',[
'template' => "<center><label>{label}</label></center><center><div style='width:400px'>{input}</div><center>"
])->checkboxList(ArrayHelper::map(KategoriDivisi::find()->all(), 'DIVISI_ID', 'DIVISI_NAMA')) ?>
–> Controller
public function actionCreate()
{
$model = new KategoriDivisi();
if ($model->load(Yii::$app->request->post()) && $model->save()) {
return $this->redirect(['view', 'id' => $model->DIVISI_ID]);
} else {
return $this->render('create', [
'model' => $model,
]);
}
}
How to change data value to string? and save in table when data is checked?