This code below is used to call the template from /app/code/ module.
$gridHtml = $block->getLayout()->createBlock(
'\Magento\Framework\View\Element\Template',
'custom_grid_new'
)->setTemplate('Magento_CustomGrid::product/view/templates/grid.phtml')
->toHtml();How to set the template from following path
/app/design/frontend/Magento/luma/Custom_Grid/templates/grid1.phtml
tried this above in above code, but is not working.
Solved! Go to Solution.
Hello @mr_bukhari
Try below code :
$gridHtml = $block->getLayout()->createBlock(
'\Magento\Framework\View\Element\Template',
'custom_grid_new'
)->setTemplate('Magento_CustomGrid::grid.phtml')
->toHtml();Hope it helps !
Hello @mr_bukhari
Try below code :
$gridHtml = $block->getLayout()->createBlock(
'\Magento\Framework\View\Element\Template',
'custom_grid_new'
)->setTemplate('Magento_CustomGrid::grid.phtml')
->toHtml();Hope it helps !