I want override the block file. I had given the details of the original file path and my overridden file.
My overridden file
app\code\Vendor\Module\etc\di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="Sm\MegaMenu\Block\MegaMenu\View" type="Sm\MageMenuCutomize\Block\MageMenu\View" />
</config>
app\code\Vendor\Module\etc\module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Sm_MageMenuCutomize" setup_version="1.0.0" schema_version="1.0.0">
</module>
</config>
app\code\Vendor\duplicate\Block\Menu\View.php
<?php
namespace Vendor\duplicate\Block\Menu;
class View extends Template
{
/* My Code*/
}
My Original File
app\code\Vendor\original\Block\Menu\View.php
<?php
namespace Vendor\original\Block\Menu;
class View extends Template
{
/* My Code*/
}
I got the empty page after this processed is finished. What is the best way to over ride this.
Thanks in advance.