Redeem Now
Read More
Read now
Menu Close
    Start a Project Request quote Reading list Switch to dark mode
    magento-hyperlocal-marketplace-guide

    Magento Development 10: Deleting

    Let’s give our blog writer an option to delete his/her blog. After this we will have completed the CRUD operations.

    Just like before we need to edit the view/frontend/templates/list.phtml

    Here we have added another column “Delete” and in the delete link we have used javascript’s confirm dialog.

    We will redirect the user to the list page after deleting the blog. So we just need to create the controller file.
    Let’s create Controller/Manage/Delete.php file,

    There is nothing much to talk about here because we have seen very similar codes before also. Only thing you have to notice is $model->delete() method. After loading the model we have deleted it with delete() and we have redirected to the list page.

    The folder structure till now,

    Next Blog -> Magento Development 11: CSS and JS

    Previous Blog -> Magento Development 09: Editing and Updating

    . . .

    Leave a Comment

    Your email address will not be published. Required fields are marked*


    Be the first to comment.

    Back to Top
    css.php
    Hire Us!
    Brief us about your requirements and we'll get back to you.
    Woo! Hooy!
    We have just recieved your project brief and our expert will contact you shortly.
    Send Again
    Close