我需要打印这个url:
http://mysite.com/hello-world-product.html
我使用的是:
echo $this->getUrl('hello-world-product.html')
并返回这个(请看最后一个字符有误):
http://mysite.com/hello-world-product.html/
如何才能返回正确的值?!
发布于 2012-01-24 23:57:16
详情请参见getUrl parameters。
echo $this->getUrl('', array('_direct' => 'hello-world-product.html'));然而,如果这个产品是一个实际的产品,那么它的使用就更有弹性:
echo $this->getUrl('catalog/product/view', array('id' => ID_OF_PRODUCT, '_use_rewrite' => true));https://stackoverflow.com/questions/8989681
复制相似问题