phpMv
-UI toolkit 2.4.12
jQuery, jQuery UI, Twitter Bootstrap and Semantic-UI library for php & php MVC Frameworks
Loading...
Searching...
No Matches
HtmlGlyphicon.php
Go to the documentation of this file.
1
<?php
2
3
namespace
Ajax\bootstrap\html
;
4
5
use
Ajax\common\html\HtmlSingleElement
;
6
use
Ajax\bootstrap\html\base\CssGlyphicon
;
7
use
Ajax\service\JString
;
8
14
class
HtmlGlyphicon
extends
HtmlSingleElement
{
15
protected
$glyphicon
;
16
17
public
function
__construct
(
$identifier
) {
18
parent::__construct(
$identifier
,
"span"
);
19
$this->_template=
'<span class="glyphicon %glyphicon%" aria-hidden="true"></span>'
;
20
}
21
27
public
function
setGlyphicon
(
$glyphicon
) {
28
if
(is_int(
$glyphicon
)) {
29
$glyphs=
CssGlyphicon::getConstants
();
30
if
(
$glyphicon
<
sizeof
($glyphs)) {
31
$glyphicon
=array_values($glyphs)[
$glyphicon
];
32
}
33
}
else
{
34
$glyphicon
=strtolower(
$glyphicon
);
35
if
(JString::startsWith(
$glyphicon
,
"glyphicon-"
)===
false
) {
36
$glyphicon
=
"glyphicon-"
.$glyphicon;
37
}
38
}
39
$this->glyphicon=
$glyphicon
;
40
}
41
47
public
static
function
getGlyphicon
($glyph) {
48
$result=
new
HtmlGlyphicon
(
""
);
49
if
(is_int($glyph)) {
50
$glyphs=
CssGlyphicon::getConstants
();
51
if
($glyph<
sizeof
($glyphs)) {
52
$glyph=array_values($glyphs)[$glyph];
53
}
54
}
55
$result->setGlyphicon($glyph);
56
return
$result;
57
}
58
}
Ajax\bootstrap\html\HtmlGlyphicon
Composant Twitter Bootstrap Glyphicon.
Definition
HtmlGlyphicon.php:14
Ajax\bootstrap\html\HtmlGlyphicon\setGlyphicon
setGlyphicon($glyphicon)
Defines the glyphicon with his name or his index.
Definition
HtmlGlyphicon.php:27
Ajax\bootstrap\html\HtmlGlyphicon\$glyphicon
$glyphicon
Definition
HtmlGlyphicon.php:15
Ajax\bootstrap\html\HtmlGlyphicon\getGlyphicon
static getGlyphicon($glyph)
return an instance of GlyphButton with a glyph defined by string or index
Definition
HtmlGlyphicon.php:47
Ajax\bootstrap\html\HtmlGlyphicon\__construct
__construct($identifier)
Definition
HtmlGlyphicon.php:17
Ajax\bootstrap\html\base\CssGlyphicon
Definition
CssGlyphicon.php:5
Ajax\common\BaseEnum\getConstants
static getConstants()
Definition
BaseEnum.php:17
Ajax\common\html\BaseWidget\$identifier
$identifier
Definition
BaseWidget.php:14
Ajax\common\html\HtmlSingleElement
Definition
HtmlSingleElement.php:7
Ajax\service\JString
Definition
JString.php:4
Ajax\bootstrap\html
Ajax
bootstrap
html
HtmlGlyphicon.php
Generated on Sun Dec 10 2023 16:15:53 for
phpMv-UI
by
doxygen
1.9.8