For ex: you have function getTitle() in Data.php at Namespace/Modulename/Helper
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>