BoxSize.php 972 Bytes
<?php

/**
 *
 * @author liuziyang
 * @version 
 */

/**
 * BoxSize helper
 *
 * @uses viewHelper Zend_View_Helper
 */
class Web_View_Helper_BoxSize extends Zend_View_Helper_Abstract {
	
	/**
	 * @var Zend_View_Interface 
	 */
	public $view;
	
	/**
	 * 
	 */
	public function boxSize($sort_ids) {
		$max_sort_id = empty($sort_ids['msort']) ? 0 : $sort_ids['msort'];
		$middle_sort_id = empty($sort_ids['misort']) ? 0 : $sort_ids['misort'];
		$small_sort_id = empty($sort_ids['sort']) ? 0 : $sort_ids['sort'];
		if ($small_sort_id == 0) {
			return null;
		}
		$this->view->boxSize = $boxSize = QINProduct_Models_Size_Client::getListBySort($small_sort_id);
		$this->view->hasSizeOpt = 1;
		if (empty($boxSize)) {
			$this->view->hasSizeOpt = 0;
			return null;
		}
		return $this->view->render('box/size.phtml');
	}
	
	/**
	 * Sets the view field 
	 * @param $view Zend_View_Interface
	 */
	public function setView(Zend_View_Interface $view) {
		$this->view = $view;
	}

}