0

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?

3
  • check this magento.stackexchange.com/questions/88632/… Commented Dec 23, 2015 at 5:17
  • @Manashvibirla:- the link yiu shared will tell how to et template to block or create and child block, but in my case i call the existing block programmatically out ide magento project folder Commented Dec 23, 2015 at 5:34
  • what is the object i need to create to create block ? Commented Dec 23, 2015 at 8:24

0