The database has a table with the id and Name fields. On the page I add a new value to the base through the form, which sends the values to the model, and then to the base. Here is the form:
<?= $form->field($addform, 'nameEx')->textInput()->label('Exercise name')?> <div class="form-group"> <?= Html::submitButton('Отправить', ['class' => 'btn btn-primary']) ?> </div> Adding works. And how to organize the update values in the database? For example, I added a value, but I want to replace Name, how to do it? Without using the generator Yii Began to do so: <?php foreach ($allNameEx as $item){ ?> <?= $form->field($addform, 'nameEx')->textInput(array('value'=>$item['name']))->label('');?> <a href="<?php echo Url::toRoute(['site/ex-delete', 'id' => $item['id']]) ?>" >Удалить</a> <?php } ?> <div class="form-group"> <?= Html::submitButton('Отправить', ['class' => 'btn btn-primary']) ?> </div> <?php ActiveForm::end(); ?> I add a form with input in which there is already a written Name value, but what to do next? After all, the form is one and takes the value nameEx one, respectively, when changing, everything will change to one value.