0

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

<?php

require_once(dirname(__FILE__).'/store/app/Mage.php');

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

$block = $app
    ->getLayout()
    ->getBlockSingleton('checkout/cart_sidebar')
    ->setTemplate('checkout/cart/sidebar.phtml');

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.