B-219 Sec-55 Noida, India
+918010221733

getBaseUrl – Magento URL Path

When developing in Magento and playing arround with Magento Themes there is some functions you should know.

If you want to get the source url of an image, javascript or file, call one of this functions adding your own path at the end.

Under every function there is an example of the output value:

http://example.com/
<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB); ?>

http://example.com/js/
<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS); ?>

http://example.com/index.php/
<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK); ?>

http://example.com/media/
<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA); ?>

http://example.com/skin/
<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN); ?> 

(Visited 48 times, 1 visits today)

Leave a reply

You must be logged in to post a comment.