Skip to content

Instantly share code, notes, and snippets.

@leite
Created March 18, 2016 20:54
Show Gist options
  • Save leite/5ad6f0eefdca7ee20d22 to your computer and use it in GitHub Desktop.
Save leite/5ad6f0eefdca7ee20d22 to your computer and use it in GitHub Desktop.
debug layout inside template/view in magento
<?php
$req = Mage::app()->getRequest();
error_log(sprintf(
"\nRequest: %s\nFull Action Name: %s_%s_%s\nHandles:\n\t%s\nUpdate XML:\n%s",
$req->getRouteName(),
$req->getRequestedRouteName(), //full action name 1/3
$req->getRequestedControllerName(), //full action name 2/3
$req->getRequestedActionName(), //full action name 3/3
implode("\n\t", $this->getLayout()->getUpdate()->getHandles()),
$this->getLayout()->getUpdate()->asString()
));
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment