Completed
Push — master ( 3e8704...4367a8 )
by Jean-Christophe
03:21
created

HtmlContainer   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 22
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A setFluid() 0 3 1
A setAlignement() 0 5 2
A setTextContainer() 0 3 1
1
<?php
2
3
namespace Ajax\semantic\html\elements;
4
5
use Ajax\common\html\HtmlDoubleElement;
6
/**
7
 * Semantic UI container component
8
 * @see http://semantic-ui.com/elements/container.html#/definition
9
 * @author jc
10
 * @version 1.001
11
 */
12
class HtmlContainer extends HtmlDoubleElement {
13
14
	public function __construct($identifier, $content="") {
15
		parent::__construct($identifier, "div");
16
		$this->content=$content;
17
		$this->setProperty("class", "ui container");
18
	}
19
20
	public function setFluid(){
21
		return $this->addToProperty("class", "fluid");
22
	}
23
24
	public function setAlignement($value="justified"){
25
		if($value!=="justified")
26
			$value.=" aligned";
27
		return $this->addToProperty("class", $value);
28
	}
29
30
	public function setTextContainer(){
31
		return $this->addToProperty("class", "text");
32
	}
33
}