HCE Project DC service web UI
0.2
Hierarchical Cluster Engine DC service web UI
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Pages
TbBadge.php
Go to the documentation of this file.
1
<?php
9
Yii::import(
'booster.widgets.TbWidget'
);
17
class
TbBadge
extends
TbWidget
{
18
22
public
$label
;
23
27
public
$encodeLabel
=
true
;
28
32
public
$htmlOptions
= array();
33
39
public
function
init
() {
40
41
$classes = array(
'badge'
);
42
43
if
($this->
isValidContext
())
44
$classes[] =
'alert-'
. $this->
getContextClass
();
45
46
if
(!empty($classes)) {
47
$classes = implode(
' '
, $classes);
48
if
(isset($this->htmlOptions[
'class'
])) {
49
$this->htmlOptions[
'class'
] .=
' '
. $classes;
50
}
else
{
51
$this->htmlOptions[
'class'
] = $classes;
52
}
53
}
54
55
if
($this->encodeLabel ===
true
) {
56
$this->label = CHtml::encode($this->label);
57
}
58
}
59
65
public
function
run
()
66
{
67
echo CHtml::tag(
'span'
, $this->htmlOptions, $this->label);
68
}
69
}
app
protected
extensions
booster
widgets
TbBadge.php
Generated on Tue Jun 30 2015 20:12:33 for HCE Project DC service web UI by
1.8.1.2