Magento – Add class name for anchor Params in Magento2 via XML

layoutmagento2

My memories in M1x, From xml use aParams tag can add class name for anchor. But in M2 seem this tag have removed. Where can i find this params in code
Anyone have experience on this case


@Marius top links from M1 i can use xml to add class name to anchor

xml you can see below link
http://pastebin.com/raw.php?i=wWLmXEnW

I want to do that in M2 but seem this way not work. Any idea on this case

What class name will render top links in M2?

Many thanks

Best Answer

If you need add class to top.links block use layouts like

<referenceBlock name="top.links">
  <arguments>
       <argument name="css_class" xsi:type="string">my-class</argument>
  </arguments>
</referenceBlock>

if you need add new link to top.links use layout like

    <referenceBlock name="top.links">
        <block class="\Magento\Framework\View\Element\Html\Link" name="top-link-myaccount">
            <arguments>
                <argument name="label" xsi:type="string">My Account</argument>
                <argument name="href" xsi:type="url">customer/getAccountUrl</argument>
                <argument name="class" xsi:type="string">top-link-myaccount</argument>
            </arguments>
        </block>
    </referenceBlock>