Skip to content

Instantly share code, notes, and snippets.

@printminion
Created February 17, 2016 15:38
Show Gist options
  • Save printminion/e0ee3d473e0efe5cd486 to your computer and use it in GitHub Desktop.
Save printminion/e0ee3d473e0efe5cd486 to your computer and use it in GitHub Desktop.
Output content of Blocks to Log file
$output = '===============================================================' . PHP_EOL;
//$output .= 'START:' . $ctrl->getFullActionName() . PHP_EOL;
$output .= 'START:' . PHP_EOL;
$blocks = Mage::app()->getLayout()->getAllBlocks();
foreach ($blocks as $blockName => $block) {
$output .= 'BLOCK: ' . $blockName . PHP_EOL;
//$output .= $observer->getLayout()->getBlock($blockId )->toHTML();
$output .= $block->toHTML();
$output .= PHP_EOL . PHP_EOL;
}
Mage::log($output, Zend_Log::WARN, 'test.log');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment