We can define templates and block in layout file, after that we can call block methods in that template file.
My question is
Is there any way to call other block methods in phtml file(template file)?
blocksmagento2template
We can define templates and block in layout file, after that we can call block methods in that template file.
My question is
Is there any way to call other block methods in phtml file(template file)?
Best Answer
You can call otherblock method inside any template file using below code,
You can pass here your block, instead of Magento\Catalog\Block\Product\ListProduct