This question already has an answer here:

i need to call top menu or header out ide the magento project in that case how to call it in magento2

in magento1.x we use



$app = Mage::app();
$session = Mage::getSingleton('core/session', array('name'=>'frontend'));

$block = $app

echo $block->toHtml();

in magento2.0 how to do it?

marked as duplicate by Alex Paliarush, liyakat, Qaisar Satti, 7ochem, Luke Rodgers Dec 23 '15 at 9:46

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.