To render one .phtml template inside another template, insert the following code at the desired location:
|
1 2 |
// Insert the search field anywhere in a template echo $this->getLayout()->createBlock("Magento\Framework\View\Element\Template")->setTemplate("Magento_Search::form.mini.phtml")->toHtml(); |
Including one template (phtml) in another template
Need help implementing this solution, or still looking for a fix to your Magento problem? Get in touch and I will be happy to help with your project.