Skip to content

Magento 2 – How to call any block function in phtml file

Today, we will guide you on How to call any block function in phtml by simple code in Magento 2

Call custom block funtion

Let’s have a look at the code.
For example your block class is as below

Then in any phtml file,you can use the following code to get method of this block.

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Share via
Copy link
Powered by Social Snap