GetProductUrl.php
766 Bytes
<?php
/**
* product url helper
*
* @uses viewHelper Zend_View_Helper
*/
class Web_View_Helper_GetProductUrl extends Zend_View_Helper_Abstract {
/**
* @var Zend_View_Interface
*/
public $view;
/**
*
*/
public function GetProductUrl($product_id, $goods_id, $product_alphabet) {
if(($product_id = intval($product_id)) < 1 || ($goods_id = intval($goods_id)) < 1 || empty($product_alphabet))
{
return '#';
}
return '/product/pro_' . $product_id . '_' . $goods_id . '/' . $product_alphabet . '.html';
}
/**
* Sets the view field
* @param $view Zend_View_Interface
*/
public function setView(Zend_View_Interface $view) {
$this->view = $view;
}
}