Skip to main content
added 8 characters in body
Source Link
Prince Patel
  • 22.9k
  • 10
  • 98
  • 121
  1. For ex: you have function getTitle() in Data.php at Namespace/Modulename/Helper

  2. In layout.xml change xsi:type="string" to xsi:type="helper" and define helper class::methodName

    Custom Module

1) For ex: you have function getTitle() in Data.php at Namespace/Modulename/Helper

<?php

namespace Namespace\Modulename\Helper;

class Data extends \Magento\Framework\App\Helper\AbstractHelper
{
    public function getTitle()
    {
       return "Testing";
    }

}

2) In layout.xml change xsi:type="string" to xsi:type="helper" and define helper class::methodName

<block class="Magento\Framework\View\Element\Html\Link\Current" ifconfig="custommodule/general/enable_footer_link" name="custommodule-link">
<arguments>
    <argument name="label" xsi:type="string">Custom Module</argument>
    <argument name="path" xsi:type="helper" helper="Namespace\Modulename\Helper\Data::getTitle"/>
</arguments>
</block>
  1. For ex: you have function getTitle() in Data.php at Namespace/Modulename/Helper

  2. In layout.xml change xsi:type="string" to xsi:type="helper" and define helper class::methodName

    Custom Module

1) For ex: you have function getTitle() in Data.php at Namespace/Modulename/Helper

<?php

namespace Namespace\Modulename\Helper;

class Data extends \Magento\Framework\App\Helper\AbstractHelper
{
    public function getTitle()
    {
       return "Testing";
    }

}

2) In layout.xml change xsi:type="string" to xsi:type="helper" and define helper class::methodName

<block class="Magento\Framework\View\Element\Html\Link\Current" ifconfig="custommodule/general/enable_footer_link" name="custommodule-link">
<arguments>
    <argument name="label" xsi:type="string">Custom Module</argument>
    <argument name="path" xsi:type="helper" helper="Namespace\Modulename\Helper\Data::getTitle"/>
</arguments>
</block>
deleted 115 characters in body
Source Link
Prince Patel
  • 22.9k
  • 10
  • 98
  • 121
  1. For ex: you have function getTitle() in Data.php at Namespace/Modulename/Helper

  2. In layout.xml change xsi:type="string" to xsi:type="helper" and define helper class::methodName

    Google Maps Store Locator Custom Module
  
  1. For ex: you have function getTitle() in Data.php at Namespace/Modulename/Helper

  2. In layout.xml change xsi:type="string" to xsi:type="helper" and define helper class::methodName

    Google Maps Store Locator
 
  1. For ex: you have function getTitle() in Data.php at Namespace/Modulename/Helper

  2. In layout.xml change xsi:type="string" to xsi:type="helper" and define helper class::methodName

    Custom Module
 
Source Link
Prince Patel
  • 22.9k
  • 10
  • 98
  • 121

  1. For ex: you have function getTitle() in Data.php at Namespace/Modulename/Helper

  2. In layout.xml change xsi:type="string" to xsi:type="helper" and define helper class::methodName

    Google Maps Store Locator