本文介绍了Magento Mage :: getUrl后缀的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当URL具有.html后缀时,在magento中处理生成URL的正确方法是什么.
What is the correct way to handle generating urls in magento when urls have .html suffixes.
例如,要获取以下产品网址:
For example, to get the following product url:
category/product.html
category/product.html
您不能简单地执行Mage::getUrl('mycategory/myproduct.html')
或Mage::getUrl('mycategory/myproduct')
但相反
Mage::getUrl() . 'mycategory/myproduct.html'
推荐答案
您-不?
拥有getUrl
方法的目的是您在URL的幕后module/controller/action
部分后面提供摘要,然后系统为您处理生成实际的HTML url.
The point of having a getUrl
method is you provide the abstract, behind the scenes module/controller/action
portions of the URL, and then the system handles generating actual HTML urls for you.
这篇关于Magento Mage :: getUrl后缀的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!