@@ 21-32 (lines=12) @@ | ||
18 | $this->content=array(); |
|
19 | } |
|
20 | ||
21 | public function addItems($items){ |
|
22 | if(JArray::isAssociative($items)){ |
|
23 | foreach ($items as $k=>$v){ |
|
24 | $this->addItem([$k,$v]); |
|
25 | } |
|
26 | }else{ |
|
27 | foreach ($items as $item){ |
|
28 | $this->addItem($item); |
|
29 | } |
|
30 | } |
|
31 | return $this; |
|
32 | } |
|
33 | ||
34 | public function setItems($items){ |
|
35 | $this->content=$items; |
@@ 91-101 (lines=11) @@ | ||
88 | $this->input=new HtmlInput($name,"hidden"); |
|
89 | } |
|
90 | ||
91 | public function addItems($items){ |
|
92 | if(JArray::isAssociative($items)){ |
|
93 | foreach ($items as $k=>$v){ |
|
94 | $this->addItem($v)->setData($k); |
|
95 | } |
|
96 | }else{ |
|
97 | foreach ($items as $item){ |
|
98 | $this->addItem($item); |
|
99 | } |
|
100 | } |
|
101 | } |
|
102 | ||
103 | public function count(){ |
|
104 | return \sizeof($this->items); |