Completed
Push — master ( 49f42f...848ec5 )
by Jean-Christophe
03:06
created

HtmlInput::setTransparent()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
namespace Ajax\semantic\html\elements;
3
4
use Ajax\semantic\html\base\HtmlSemDoubleElement;
5
use Ajax\semantic\html\base\constants\State;
6
use Ajax\semantic\html\base\constants\Variation;
7
use Ajax\semantic\html\base\traits\IconTrait;
8
use Ajax\semantic\html\collections\form\traits\TextFieldsTrait;
9
use Ajax\semantic\html\collections\form\traits\FieldTrait;
10
11
class HtmlInput extends HtmlSemDoubleElement {
12
	use IconTrait,TextFieldsTrait,FieldTrait;
13
14
	public function __construct($identifier, $type="text", $value="", $placeholder="") {
15
		parent::__construct("div-" . $identifier, "div", "ui input");
16
		$this->content=[ "field" => new \Ajax\common\html\html5\HtmlInput($identifier, $type, $value, $placeholder) ];
17
		$this->_states=[ State::DISABLED,State::FOCUS,State::ERROR ];
18
		$this->_variations=[ Variation::TRANSPARENT ];
19
	}
20
21
	public function getField() {
22
		return $this->content["field"];
23
	}
24
25
	public static function outline($identifier, $icon, $value="", $placeholder="") {
26
		$result=new HtmlInput($identifier, "text", $value, $placeholder);
27
		$result->addToProperty("class", "transparent");
28
		$result->addIcon($icon)->setOutline();
29
		return $result;
30
	}
31
}