I try to override this file :
vendor/magento/framework/View/Element/Html/Link/Current.php
I create a module.xml, registration.php and di.xml
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="Magento\Framework\View\Element\Html\Link\Current" type="MyNamespace\MagentoFramework\Model\Framework\View\Element\Html\Link\Current" />
</config>
My override class :
namespace MyNamespace\MagentoFramework\Model\Framework\View\Element\Html\Link;
class Current extends \Magento\Framework\View\Element\Html\Link\Current
{
/**
* Get href URL
*
* @return string
*/
public function getHref()
{
return $this->getUrl($this->getPath());
}
}
The module is enable but this file doesn't override the original.
Do you have any suggestions ? Thanks !