Magento – how to call phtml file of another folder inside phtml file of another folder in magento 2

magento2phtml

I have a.phtml file in one folder in my theme folder and b.phtml in another folder now i want to call inside one phtml file to another b.phtml file

Best Answer

You can call any template file inside any template file using below line

<?php echo $this->getLayout()->createBlock('Magento\Framework\View\Element\Template')->setTemplate('Company_Module::test.phtml')->toHtml(); ?>