Home » YII Delete Record

Delete Record

To delete records in the database, following these steps. We have named our Yii2 folder as delete.

Step 1 Create Model file

Create a model file child.php in frontend/models folder.

Step 2 Create action in controllers

Create an action actionDelete in ChildController.php file.

Step 3 Run it

Run it on the browser.

http://localhost/delete/frontend/web/index.php?r=child%2Findex

YII Delete record 1

Look at the above snapshot, click the Delete option in the last row of the table.

Look at the above snapshot, respective row is deleted from the table.

YII Delete record 2

Next TopicYII Sessions

You may also like