Skip to content

Instantly share code, notes, and snippets.

@qaiserali
Last active March 8, 2016 08:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qaiserali/73057320b97ace5f7ccd to your computer and use it in GitHub Desktop.
Save qaiserali/73057320b97ace5f7ccd to your computer and use it in GitHub Desktop.
Load block outside the Magento scope
<?php
require_once 'app/Mage.php';
umask(0);
Mage::app();
$layout = Mage::getSingleton('core/layout');
//load default xml layout handle and generate blocks
$layout->getUpdate()->load('default');
$layout->generateXml()->generateBlocks();
/get the loaded head and header blocks and output
$headBlock = $layout->getBlock('head');
echo $headBlock->toHtml();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment