I have added a login link in Magento top links by using deafult.xml and set the URL as default Magento sign-in URL
default.xml
<block class="Learning\Module\Block\Link1" name="custom-header-linkyy">
<arguments>
<argument name="label" xsi:type="string" translate="true">Login</argument>
<argument name="path" xsi:type="string" translate="true">customer/account/login/</argument>
</arguments>
</block>
</referenceBlock>
link1.php
<?php
namespace Learning\Module\Block;
class Link1 extends \Magento\Framework\View\Element\Html\Link
{
/**
* Render block HTML.
*
* @return string
*/
protected function _toHtml()
{
if (false != $this->getTemplate())
{
return parent::_toHtml();
}
return '<li ><a ' . $this->getLinkAttributes() . ' >' . $this->escapeHtml($this->getLabel()) . '</a></li>';
}
}
now what I want is when a customer clicks and logged in successfully that button should be changed to logout is there any solution for this thanks in advance