The database has a Name field (in which the names of future input are recorded). In the model, I pull out all the Name that is and they are written to the array. In the controller I transfer this array to views. In the views / index file, you need to make a form in which there will be a checkbox with the names that they will receive from Name.
//$nameRecordsCount - это количество всех Name в базе //$allNameEx - это массив с id и Name // То есть $allNameEx[$i]['name']; вернет например name1; //И вот я тут хочу передать имя в строку после, $model, но я получаю ошибку //Attribute name must contain word characters only. <?= $form->field($model, 'date')->widget(yii\jui\DatePicker::className(),['dateFormat' => 'yyyy-MM-dd'])?> <?php for ($i = 0; $i < $nameRecordsCount; $i++) { ?> <?php $formName = (string)$allNameEx[$i]['name'];?> <?= $form->field($model, "$formName")->checkbox() ?> Why and how to solve?
ps sorry for the quality of the question, I do not know yet how to edit the pasted code.