Completed
Push — master ( 03d1b2...8466ff )
by Jean-Christophe
03:11
created

HtmlGridCol::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 2
eloc 5
nc 2
nop 2
1
<?php
2
3
namespace Ajax\semantic\html\content;
4
5
use Ajax\semantic\html\base\HtmlSemDoubleElement;
6
use Ajax\semantic\html\base\Wide;
7
8
class HtmlGridCol extends HtmlSemDoubleElement{
9
	public function __construct($identifier,$width){
10
		parent::__construct($identifier,"div");
11
		$this->setClass("column");
12
		if(isset($width))
13
			$this->setWidth($width);
14
	}
15
16
	public function setWidth($width){
17
		if(\is_int($width)){
18
			$width=Wide::getConstants()["W".$width];
19
		}
20
		$this->addToPropertyCtrl("class", $width, Wide::getConstants());
21
		return $this->addToPropertyCtrl("class", "wide",array("wide"));
22
	}
23
}