Completed
Push — master ( 2affe6...aa2804 )
by Jean-Christophe
03:17
created

HtmlListItem::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 4
nc 1
nop 2
1
<?php
2
3
namespace Ajax\semantic\html\content;
4
5
use Ajax\semantic\html\base\HtmlSemDoubleElement;
6
use Ajax\semantic\html\elements\HtmlIcon;
7
8
class HtmlListItem extends HtmlSemDoubleElement {
9
	protected $image;
10
	public function __construct($identifier,$content) {
11
		parent::__construct($identifier, "div", "item");
12
		$this->_template='<%tagName% id="%identifier%" %properties%>%image%%content%</%tagName%>';
13
		$this->content=$content;
14
	}
15
	public function addIcon($icon){
16
		$content=$this->content;
17
		$this->content=new HtmlSemDoubleElement("content-".$this->identifier,"div","content");
18
		$this->content->setContent($content);
19
		$this->content->addContent(new HtmlIcon("icon".$this->identifier, $icon),true);
20
	}
21
}