- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2019
04:22 AM
07-12-2019
04:22 AM
Override core block in my custom theme
Hello All,
I want to override core block file i.e, (vendor/magento/module-theme/Block/Html/Topmenu.php) for my custom theme.
Can anyone suggest me anything for this.
Thanks
Magento Developer
Ankita Biswas
Ankita Biswas
Labels:
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2019
02:26 PM
07-12-2019
02:26 PM
Re: Override core block in my custom theme
Hello Ankita,
You can override core block in you theme like that:
vendor/theme/Magento_Theme/Block/Html/Topmenu.php
Magento 2 Professional Developer
https://nslayout.com/
https://nslayout.com/
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2019
08:02 PM
07-12-2019
08:02 PM
Re: Override core block in my custom theme
You can override core block using di,xml.
for more info you can visit following link.
overriding-rewriting-classes-magento2/
I hope it will help you!