If I want to override a controller in my custom module am I able to use existing functionality of default controller in magento 2. If yes then how?


1 Answer 1


Use di.xml :

<preference for="<core controller path>" type="<module's controller path>" />

Copy core function and override it, You can use it in your controller.

  • I did this. But it is not working. Can I use default execute function of default controller?
    – user48589
    Dec 22, 2016 at 13:03

Not the answer you're looking for? Browse other questions tagged or ask your own question.