Completed
Push — master ( db82f0...0ba4b1 )
by Jean-Christophe
03:22
created

HtmlImage::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 4
nc 1
nop 3
1
<?php
2
3
namespace Ajax\semantic\html\elements;
4
5
use Ajax\common\html\html5\HtmlImg;
6
use Ajax\semantic\html\base\traits\BaseTrait;
7
8
class HtmlImage extends HtmlImg {
9
	use BaseTrait;
10
11
	public function __construct($identifier, $src="", $alt="") {
12
		parent::__construct($identifier, $src, $alt);
13
		$this->_baseClass="ui image";
14
		$this->setClass($this->_baseClass);
15
	}
16
17
	public function setCircular(){
18
		return $this->addToProperty("class", "circular");
19
	}
20
21
	public function asAvatar($caption=NULL){
22
		if(isset($caption))
23
			$this->wrap("",$caption);
24
		return $this->addToProperty("class", "avatar");
25
	}
26
}