Completed
Push — master ( b0560a...f1cdc4 )
by Jean-Christophe
03:54
created

HtmlSearch   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 18
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A createField() 0 4 1
A createResult() 0 4 1
1
<?php
2
3
namespace Ajax\semantic\html\modules;
4
5
use Ajax\semantic\html\base\HtmlSemDoubleElement;
6
use Ajax\semantic\html\elements\HtmlInput;
7
8
class HtmlSearch extends HtmlSemDoubleElement {
9
10
	public function __construct($identifier, $placeholder="") {
11
		parent::__construct("search-" . $identifier, "div", "ui search", array ());
12
		$this->createField();
13
		$this->createResult();
14
	}
15
16
	private function createField() {
17
		$this->content["field"]=new HtmlInput($this->identifier);
18
		return $this->content["field"];
19
	}
20
21
	private function createResult() {
22
		$this->content["result"]=new HtmlSemDoubleElement("results-" . $this->identifier, "div", "results");
23
		return $this->content["result"];
24
	}
25
}