Completed
Push — master ( b49918...3cf661 )
by Jean-Christophe
03:33
created

HtmlInput::setPlaceholder()   A

Complexity

Conditions 2
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 2
eloc 4
nc 2
nop 1
1
<?php
2
3
namespace Ajax\common\html\html5;
4
5
use Ajax\common\html\HtmlSingleElement;
6
use Ajax\service\JString;
7
8
class HtmlInput extends HtmlSingleElement {
9
10
	public function __construct($identifier,$type="text",$value=NULL,$placeholder=NULL) {
11
		parent::__construct($identifier, "input");
12
		$this->setProperty("name", $identifier);
13
		$this->setValue($value);
14
		$this->setPlaceholder($placeholder);
15
		$this->setProperty("type", $type);
16
	}
17
18
	public function setValue($value) {
19
		if(isset($value))
20
		$this->setProperty("value", $value);
21
		return $this;
22
	}
23
24
	public function setInputType($value) {
25
		return $this->setProperty("type", $value);
26
	}
27
28
	public function setPlaceholder($value){
29
		if(JString::isNotNull($value))
30
			$this->setProperty("placeholder", $value);
31
		return $this;
32
	}
33
}