cancel
Showing results for 
Search instead for 
Did you mean: 

How i can Pass Html Attributes to a Block using XML in Magento 2.3.0

How i can Pass Html Attributes to a Block using XML in Magento 2.3.0

i am trying to assign an id to each of My Account Dashboard Link Here is what i did so Far

<referenceBlock class="Magento\Customer\Block\Account\SortLinkInterface"  name="customer-account-navigation-address-link">
   <arguments>
       <argument name="attributes" xsi:type="array">
            <item name="id" xsi:type="string">My-link</item>
       </argument>
   </arguments>
</referenceBlock>

i did this Already and Working in magento 2.3.3

in 2,3,0 Links From Module Magento_Customer is not getting Id.. All other Module Links are working fine

 

i want to See  am i reciveing attribute in block so i navigated to

 Magento\Framework\View\Element\Html\Link\Current.php 

private function getAttributesHtml()
{
         echo "<pre>";
         print_r($this->getAttributes());
         echo "</pre>";
         $attributesHtml = '';
         $attributes = $this->getAttributes();
         if ($attributes) {
             foreach ($attributes as $attribute => $value) {
                 $attributesHtml .= ' ' . $attribute . '="' . $this->escapeHtml($value) . '"';
             }
        }
       return $attributesHtml;
}

Need Help