Home » YII Update Record

Update Record

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.

http://localhost/dbb/frontend/web/index.php?r=child%2Fedit&id=6

YII Update record 1

Click on Update, information will be updated.

YII Update record 2

Look at the last row in above snapshot, data is updated.

Next TopicDelete Record

You may also like