菜单

Magento getUrl

2015年11月26日 - magento

To Retrieve URL path in STATIC BLOCK

Java代码 收藏代码
To get SKIN URL
{{skin url=’images/sampleimage.jpg ‘}}

To get Media URL
{{media url=’/sampleimage.jpg’}}

To get Store URL
{{store url=’mypage.html’}}

To get Base URL
{{base url=’yourstore/mypage.html’}}

TO Retrieve URL path in PHTML

Java代码 收藏代码
Not secure Skin URL:
getSkinUrl(‘images/sampleimage.jpg’) ?>

Secure Skin URL
getSkinUrl(‘images/ sampleimage.gif’, array(‘_secure’=>true)) ?>

Get Current URL
$current_url = Mage::helper(‘core/url’)->getCurrentUrl();

Get Home URL
$home_url = Mage::helper(‘core/url’)->getHomeUrl();

Get Magento Media Url
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK);

Get Magento Media Url
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);

Get Magento Skin Url
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);

Get Magento Store Url
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);

Get Magento Js Url
Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS);

Java代码 收藏代码
Mage::getUrl(‘*/*’);
// http://www.example.com/cms/page/

Mage::getUrl(‘index.html’);
// http://www.example.com/index.html

Mage::getUrl(‘cms/page/view’, array(‘id’ => 1));
// http://www.example.com/cms/page/view/id/1

发表评论

电子邮件地址不会被公开。 必填项已用*标注