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

HtmlTextarea::setRows()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace Ajax\common\html\html5;
4
5
use Ajax\common\html\HtmlDoubleElement;
6
use Ajax\service\JString;
7
8
class HtmlTextarea extends HtmlDoubleElement {
9
10
	public function __construct($identifier,$value=NULL,$placeholder=NULL,$rows=NULL) {
11
		parent::__construct($identifier, "textarea");
12
		$this->setValue($value);
13
		$this->setPlaceholder($placeholder);
14
		if(isset($rows))
15
			$this->setRows($rows);
16
	}
17
	public function setValue($value) {
18
		if(isset($value))
19
			$this->setContent($value);
20
		return $this;
21
	}
22
23
	public function setPlaceholder($value){
24
		if(JString::isNotNull($value))
25
			$this->setProperty("placeholder", $value);
26
		return $this;
27
	}
28
29
	public function setRows($count){
30
		$this->setProperty("rows", $count);
31
	}
32
}