| @@ 21-31 (lines=11) @@ | ||
| 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 | } |
|
| 32 | ||
| 33 | public function setItems($items){ |
|
| 34 | $this->content=$items; |
|
| @@ 86-96 (lines=11) @@ | ||
| 83 | $this->input=new HtmlInput($name,"hidden"); |
|
| 84 | } |
|
| 85 | ||
| 86 | public function addItems($items){ |
|
| 87 | if(JArray::isAssociative($items)){ |
|
| 88 | foreach ($items as $k=>$v){ |
|
| 89 | $this->addItem($v)->setData($k); |
|
| 90 | } |
|
| 91 | }else{ |
|
| 92 | foreach ($items as $item){ |
|
| 93 | $this->addItem($item); |
|
| 94 | } |
|
| 95 | } |
|
| 96 | } |
|
| 97 | ||
| 98 | public function count(){ |
|
| 99 | return \sizeof($this->items); |
|