Completed
Push — master ( c6c18d...79b035 )
by Jean-Christophe
03:25
created

AbstractHtmlFormRadioCheckbox::setInput()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace Ajax\semantic\html\collections\form;
4
5
use Ajax\semantic\html\collections\form\HtmlFormInput;
6
/**
7
 * Abstract class for Semantic Radio and Checkbox
8
 * @author jc
9
 * @version 1.001
10
 */
11
abstract class AbstractHtmlFormRadioCheckbox extends HtmlFormField {
12
	protected $_input;
13
14
	public function __construct($identifier, $name=NULL,$label=NULL,$value=NULL) {
15
		$input=new HtmlFormInput($identifier,$label,"checkbox",$value);
16
		parent::__construct("rField-".$identifier, $input);
17
		if(isset($label)){
18
			$input->swapLabel();
19
			$label=$input->getLabel();
20
			$label->setClass="hidden";
21
			$label->setProperty("tabindex",0);
22
		}
23
		$this->_input=$input;
24
	}
25
26
	public function getInput() {
27
		return $this->_input;
28
	}
29
30
	public function setInput($_input) {
31
		$this->_input=$_input;
32
		return $this;
33
	}
34
35
}