Home > Magento, Programming > Get URL base for Magento

Get URL base for Magento

This is the way to get URL base on Magento Frameworks


<?php

echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
// output: http://yoursite.com/
echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS);
// output: http://yoursite.com/js/
echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK);
// output: http://yoursite.com/index.php/
echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
// output: http://yoursite.com/media/
echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);
// output: http://yoursite.com/skin/</a>

?>
Categories: Magento, Programming Tags:
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: