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

AbstractHtmlFormRadioCheckbox   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 25
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 11 2
A getInput() 0 3 1
A setInput() 0 4 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
}