holy shit

寺夺喜从天降

MAGENETO获取相关URL路径

MAGENTO有一个内建的获取URL路径的功能,相关函数是getBaseUrl()

1. Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS);
http://yoursitename.com/js/
2. Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK);
http://yoursitename.com/index.php/
3. Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
http://yoursitename.com/media/
4. Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);
http://yoursitename.com/skin/
5. Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
http://yoursitename.com/
这些参数都能在Mage_Core_Model_Store里面找到
示范代码:
<?php
echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
?>
posted @ 2011-05-30 22:41  潜水鱼  阅读(496)  评论(0编辑  收藏  举报

holy shit on foot