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

HtmlFormInput::__construct()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 5
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 3
eloc 4
nc 2
nop 5
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
}