magento如何在phtml文件中获取url?

1. 获取 Base Url :

Mage::getBaseUrl();

2. 获取 Skin Url :

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);

(a) Unsecure Skin Url :

$this->getSkinUrl('images/imagename.jpg');

(b) Secure Skin Url :

$this->getSkinUrl('images/imagename.gif', array('_secure'=>true));

3. 获取 Media Url :

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);

4. 获取 Js Url :

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS);

5. 获取 Store Url :

Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);

6. 获取 Current Url

Mage::helper('core/url')->getCurrentUrl();

magento如何在cms pages或static blocks中获取Url ?

1. 获取 Base Url :

{{store url=""}}

2. 获取 Skin Url :

{{skin url='images/imagename.jpg'}}

3. 获取 Media Url :

{{media url='imagename.jpg'}}

4. 获取 Store Url :

{{store url='mypage.html'}}