Skip to main content
edited body
Source Link
Anil Suthar
  • 4.7k
  • 1
  • 15
  • 22

In terms of PHP :: is a Scope Resolution Operator. Used to access static elements of a Class.

In Magento, Mage::helper(), here helper() is a STATIC function listed in Mage.php file, like public static function helper($name).

From your exampe, Mage::helper('catalog/category'), this will return an Object of Mage_Catalog_Helper_Category objecthelper. Check this line in helper function definition, $helperClass = self::getConfig()->getHelperClassName($name);

In terms of PHP :: is a Scope Resolution Operator. Used to access static elements of a Class.

In Magento, Mage::helper(), here helper() is a STATIC function listed in Mage.php file, like public static function helper($name).

From your exampe, Mage::helper('catalog/category'), this will return an Object of Mage_Catalog_Helper_Category object. Check this line in helper function definition, $helperClass = self::getConfig()->getHelperClassName($name);

In terms of PHP :: is a Scope Resolution Operator. Used to access static elements of a Class.

In Magento, Mage::helper(), here helper() is a STATIC function listed in Mage.php file, like public static function helper($name).

From your exampe, Mage::helper('catalog/category'), this will return an Object of Mage_Catalog_Helper_Category helper. Check this line in helper function definition, $helperClass = self::getConfig()->getHelperClassName($name);

Source Link
Anil Suthar
  • 4.7k
  • 1
  • 15
  • 22

In terms of PHP :: is a Scope Resolution Operator. Used to access static elements of a Class.

In Magento, Mage::helper(), here helper() is a STATIC function listed in Mage.php file, like public static function helper($name).

From your exampe, Mage::helper('catalog/category'), this will return an Object of Mage_Catalog_Helper_Category object. Check this line in helper function definition, $helperClass = self::getConfig()->getHelperClassName($name);