Completed
Push — master ( 409900...f20dfb )
by Jean-Christophe
03:24
created

HtmlIconGroups::addIcon()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 6

Duplication

Lines 8
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 8
loc 8
rs 9.4285
cc 2
eloc 6
nc 2
nop 2
1
<?php
2
3
namespace Ajax\semantic\html\elements;
4
5
use Ajax\semantic\html\base\HtmlSemDoubleElement;
6
/**
7
 * Semantic Icons group component
8
 * @see http://semantic-ui.com/elements/icon.html#/definition
9
 * @author jc
10
 * @version 1.001
11
 */
12
class HtmlIconGroups extends HtmlSemDoubleElement {
13
14
	public function __construct($identifier,$size="") {
15
		parent::__construct($identifier, "i");
16
		$this->setProperty("class", "icons");
17
		$this->setSize($size);
18
	}
19
20
	public function add($icon,$size=""){
21
		$iconO=$icon;
22
		if(\is_string($icon)){
23
			$iconO=new HtmlIcon("icon-".$this->identifier, $icon);
24
			$iconO->setSize($size);
25
		}
26
		$this->addContent($iconO);
27
	}
28
29
	public function getIcon($index){
30
		return $this->content[$index];
31
	}
32
}