Completed
Push — master ( cd0fd2...97e05d )
by Jean-Christophe
03:14
created

HtmlIconMenu::createItem()   A

Complexity

Conditions 1
Paths 1

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 1
eloc 5
nc 1
nop 1
1
<?php
2
3
namespace Ajax\semantic\html\collections;
4
5
use Ajax\semantic\html\collections\HtmlMenu;
6
use Ajax\bootstrap\html\HtmlLink;
7
use Ajax\semantic\html\elements\HtmlIcon;
8
9
/**
10
 * Semantic Menu component with only icons
11
 * @see http://semantic-ui.com/collections/menu.html
12
 * @author jc
13
 * @version 1.001
14
 */
15
class HtmlIconMenu extends HtmlMenu{
16
17
18
	/**
19
	 * @param string $identifier
20
	 * @param array $items icons
21
	 */
22
	public function __construct( $identifier, $items=array()){
23
		parent::__construct( $identifier, $items);
24
		$this->addToProperty("class", "icon");
25
	}
26
27
28
	/**
29
	 * {@inheritDoc}
30
	 * @see \Ajax\semantic\html\collections\HtmlMenu::createItem()
31
	 */
32
	protected function createItem($value) {
33
		$count=\sizeof($this->content);
34
		$value=new HtmlIcon("icon-".$count, $value);
35
		$itemO=new HtmlLink("item-".$count,"",$value);
36
		return $itemO->setClass("item");
37
	}
38
}