Get URL paths for skin, media, Js OR base URL

Get URL paths for skin, media, Js OR retrive 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://www.mystore.com/js/

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK);
http://www.mystore.com/index.php/

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
http://www.mystore.com/media/

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);
http://www.mystore.com/skin/

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
http://www.mystore.com/

Anyone needing to retrieve the base URL path from Magento, just place this one line of code and there you have it! Hope this helps someone.

 

 

<?php echo Mage::getBaseUrl(); ?>

Enjoy!

DOWNLOAD SOLUTION HERE