Completed
Push — master ( 012895...9e0835 )
by Jean-Christophe
03:33
created

HtmlFormInput   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 4
c 3
b 0
f 0
lcom 0
cbo 3
dl 0
loc 13
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 3
A setReadonly() 0 3 1
1
<?php
2
3
namespace Ajax\semantic\html\collections\form;
4
5
use Ajax\common\html\html5\HtmlInput;
6
use Ajax\semantic\html\collections\form\traits\TextFieldsTrait;
7
8
class HtmlFormInput extends HtmlFormField {
9
	use TextFieldsTrait;
10
11
	public function __construct($identifier, $label=NULL,$type="text",$value=NULL,$placeholder=NULL) {
12
		if(!isset($placeholder) && $type==="text")
13
			$placeholder=$label;
14
		parent::__construct("field-".$identifier, new HtmlInput($identifier,$type,$value,$placeholder), $label);
15
	}
16
17
	public function setReadonly(){
18
		$this->getField()->setProperty("readonly", "");
19
	}
20
}