How To Load Block on Templates in Magento 2 - Magento Source24

 

How To Load Block on Templates in Magento 2

How To Load Block on Templates in Magento 2 - Magento Source24

In this Post I'm Share with you to How To Load Block on Templates in Magento 2  

You can call it like this.


Below code are use to load  direct block load on template (phtml) file in magento : 

in this class getOrderDeatils() is function define in the Wheelbuilderjson class file


<?php

$blockObj= $block->getLayout()->createBlock('Dww\Quote\Block\Adminhtml\Wheelbuilderjson');

$data=$blockObj->getOrderDeatils();

?>




 

Deepak Kumar Bind

Success is peace of mind, which is a direct result of self-satisfaction in knowing you made the effort to become the best of which you are capable.

Post a Comment

If you liked this post please do not forget to leave a comment. Thanks

Previous Post Next Post