Tuesday, 9 October 2012

Magento :: get URL paths for skin, media, Js OR base URL

If anyone of you facing problems to fetch the Magento URL paths of  skin, media, Js or simple base URL of Magento while customization/programming, then following lines should be helpful for you:
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS);
//http://magento.demo/js/
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK);
//http://magento.demo/index.php/
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
//http://magento.demo/media/
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);
//http://magento.demo/skin/
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
//http://magento.demo/

1 comment:

Note: only a member of this blog may post a comment.