I want to get my header part as html and I will use this in some other site with API call. For that I am trying to render using Magento\Theme\Block\Html\Header
block and the following code:
$this->_view->getLayout()
->createBlock('Magento\Theme\Block\Html\Header')
->setTemplate('Magento_Theme::html/header.phtml')
->toHtml();
But it is not working. Can someone please suggest how to correct this or some other method to implement.
Invalid template file: 'Magento_Theme::html/footer.phtml' in module: 'Magento_Theme' block's name: 'html\\footer_0'
$this->_view->getLayout()->createBlock('Magento\Theme\Block\Html\Header')->toHtml();