Is the following codes in the phtml $this->helper('catalog/category')
and Mage::helper('catalog/category')
returns the same object?
What is the meaning of using $this->helper()
and Mage::helper()
?
blockshelpertemplate
Is the following codes in the phtml $this->helper('catalog/category')
and Mage::helper('catalog/category')
returns the same object?
What is the meaning of using $this->helper()
and Mage::helper()
?
Best Answer
Basically the
$this->helper
is calling the function that is contained inside the current template's block class. TheMage::helper
is calling the function in the "God" class.The
$this->helper
normally calls a function in the classMage_Core_Block_Abstract
which checks the layout for a helper and then simply calls the normalMage::helper
if it cannot find one.