P
P
prozrost2017-02-17 01:18:17
Yii
prozrost, 2017-02-17 01:18:17

Why is it throwing a "must be a string" error when using checkboxlist?

I want to use checkboxlist in my yii2 site.
Trying to use it like this

<?= $form->field($Form, 'techies')->checkboxList(['no'=>'Нет', 'yes_camera'=>'Да,только камера', 'yes_both'=>'да,компьютер и камера'])->label(false) ?>

When you try to submit the form, it gives an error 'techies must be a string', as I understand it, that it does not pass validation. But here both the key and the value are text.
Rules:
[ 'techies', 'english_level', 'photo_1', 'photo_2', 'photo_3', 'photo_4', 'photo_5'], 'string'],

So what is the correct way to use this checkbox list?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question