To get block in magento1 we use echo $this->getLayout()->createBlock('module/adminhtml_module_grid')->toHtml()
.
What is the similar function in magento2?
You can do the same in Magento2
If your Block
class extends Magento\Framework\View\Element\Template
$block->getLayout()->createBlock('something/something')->toHtml()
If your Block
class does not extend Magento\Framework\View\Element\Template
then you can Inject the \Magento\Framework\View\LayoutInterface
in your block construct
and you can use use this pattern.
A grid block
, I did same in magento1. Is it possible to load grid in magento2 phtml file?