To update the records in the database, following these steps. We have named our Yii2 folder as update.
Step 1 Create Model file
Create a model file child.php in frontend/models folder.
Step 2 Add action in controllers
Add the update action actionEdit in controllers file ChildController.php.
Step 3 Create View file
Create a file edit.php in frontend/view/child folder.
Step 4 Run it
Run it on the browser.
Click on Update, information will be updated.
Look at the last row in above snapshot, data is updated.