Completed
Push — master ( 0c3815...012895 )
by Jean-Christophe
03:40
created

HtmlSticky::setContext()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace Ajax\semantic\html\modules;
4
5
use Ajax\semantic\html\base\HtmlSemDoubleElement;
6
use Ajax\JsUtils;
7
8
class HtmlSticky extends HtmlSemDoubleElement {
9
	private $_params=array();
10
11
	public function __construct($identifier,$context=NULL,$content=NULL) {
12
		parent::__construct($identifier, "div", "ui sticky", $content);
13
		if(isset($content))
14
			$this->setContext($context);
15
	}
16
17
	public function setContext($context){
18
		$this->_params["context"]=$context;
19
		return $this;
20
	}
21
22
	/**
23
	 * {@inheritDoc}
24
	 * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::run()
25
	 */
26
	public function run(JsUtils $js){
27
		parent::run($js);
28
		return $js->semantic()->sticky("#".$this->identifier,$this->_params);
29
	}
30
}