Problem
I want to add an attribute to current link in Magento 2 Customer Dashboard i Checked Magento\Framework\View\Element\Html\Link\Current, there in Line 119 All the Link Having an Li have a function $this->getAttributesHtml() by which all none current link can assigned an HTML attribute passed from XML
Now the current link hasn't assigned $this->getAttributesHtml() that why the attribute passed through XML is Not assigned to current link
I tried to Override Current Class as Follows
etc\frontend\di.xml
<preference
for="Magento\Framework\View\Element\Html\Link\Current"
type="Vendor\Module\View\Element\Html\Link\Current" />
Vendor\Module\View\Element\Html\Link\Current
Changed this Condition
if ($this->isCurrent()) {
$html = '<li class="nav item current">';
$html .= '<strong'>'
. $this->escapeHtml(__($this->getLabel()))
. '</strong>';
$html .= '</li>';
}
To
if ($this->isCurrent()) {
$html = '<li class="nav item current">';
$html .= '<strong '.$this->getAttributesHtml() .'>'
. $this->escapeHtml(__($this->getLabel()))
. '</strong>';
$html .= '</li>';
}
If I make a change in Core File I works Fine But in Overridden Class Its Now Working
Need Help

