BoxSearch.php
1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
/**
* BoxSearch helper
*
* @uses viewHelper Zend_View_Helper
*/
class Web_View_Helper_BoxSearch extends Zend_View_Helper_Abstract {
private $conditionSelectMap = array(
'discount',
'gender',
'brand',
'price',
'size'
);
private $conditionDefaultSelectMap = array(
'discount',
'gender',
'brand',
'price'
);
/**
* @var Zend_View_Interface
*/
public $view;
/**
*
*/
public function boxSearch(array $sort_ids, array $selectMap = array(), $brand_id = 0, $url='/search?', $hideOpt=array()) {
if (empty($selectMap) && isset($sort_ids['sort'])) {
// $conditionSelect = QModels_Search_Client::getConditionSelectOne($sort_ids['sort']);
$conditionSelect = array();
$selectMap = empty($conditionSelect) ? $this->conditionDefaultSelectMap : $conditionSelect;
}
$this->view->brand_id = $brand_id;
$this->view->boxConditionSelect = $selectMap;
$this->view->url = $url;
$this->view->hideOpt = $hideOpt;
return $this->view->render('box/search.phtml');
}
/**
* Sets the view field
* @param $view Zend_View_Interface
*/
public function setView(Zend_View_Interface $view) {
$this->view = $view;
}
}