magento常用函数列表



获取系统的字符集:

 

Mage::getStoreConfig('design/head/default_charset')

 

获取

http://magentonotes.com/

echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);

 

获取

http://magentonotes.com/js/

echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS);

 

获取

http://magentonotes.com/index.php/

echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK);

 

获取

http://magentonotes.com/media/

echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);

 

获取

http://magentonotes.com/skin/

echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN);

 

简化操作:

 

echo Mage::getBaseUrl('skin');

echo Mage::getBaseUrl('media');

echo Mage::getBaseUrl('js');

 

//

获取首页

 

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

//

返回当前页面的路径

 

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

 

//

显示登录路径

 

echo $this->getUrl('customer/account/login');

 

显示图片的方法:

 

echo $this->getSkinUrl('images/qty.gif')

 

你可能感兴趣的:(mangento)