Completed
Push — master ( 22ba15...552305 )
by Jean-Christophe
03:10
created

HtmlFormDropdown::getDataField()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Ajax\semantic\html\collections\form;
4
5
use Ajax\semantic\html\collections\form\HtmlFormField;
6
use Ajax\semantic\html\modules\HtmlDropdown;
7
8
class HtmlFormDropdown extends HtmlFormField {
9
10
	public function __construct($identifier,$items=array(), $label=NULL,$value=NULL,$multiple=false) {
11
		parent::__construct("field-".$identifier, (new HtmlDropdown("dropdown-".$identifier,$value,$items))->asSelect($identifier,$multiple), $label);
12
	}
13
14
	public function setItems($items){
15
		return $this->getField()->setItems($items);
16
	}
17
	public function addItem($item,$value=NULL,$image=NULL){
18
		return $this->getField()->addItem($item,$value,$image);
19
	}
20
	public static function multipleDropdown($identifier,$items=array(), $label=NULL,$value=NULL){
21
		return new HtmlFormDropdown($identifier,$items,$label,$value,true);
22
	}
23
24
	public function getDataField(){
25
		return $this->getField()->getInput();
26
	}
27
}