Last active
May 29, 2018 16:12
-
-
Save AndresInSpace/fd47908c4876b1c0913fc1cdbeae165c to your computer and use it in GitHub Desktop.
Magento 1.x Cheatsheet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Get Layout Handles Used | |
var_dump(Mage::app()->getLayout()->getUpdate()->getHandles()); | |
//Get loaded layout blocks | |
var_dump(array_keys(Mage::app()->getLayout()->getAllBlocks())); | |
//Add to Global Messages | |
Mage::getSingleton('core/session')->addSuccess('Success Message'); | |
Mage::getSingleton('core/session')->addError('Error Message'); | |
Mage::getSingleton('core/session')->addWarning('Warning Message'); | |
Mage::getSingleton('core/session')->addNotice('Notice Message'); | |
can use | |
customer/session | |
catalog/session | |
//Dump callstack - useful for debugging | |
private function get_callstack() { | |
$dt = debug_backtrace(); | |
$cs = array(); | |
foreach ($dt as $t) { | |
$cs[] = $t['file'] . ' line ' . $t['line'] . ' calls ' . $t['function'] . "()" ; | |
} | |
return $cs; | |
} | |
Mage::log($this->get_callstack(),null,'callstack.log'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment