phpMv  -UI toolkit 2.4.12
jQuery, jQuery UI, Twitter Bootstrap and Semantic-UI library for php & php MVC Frameworks
HtmlGlyphicon.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Ajax\bootstrap\html;
4 
8 
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)) {
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)) {
51  if ($glyph<sizeof($glyphs)) {
52  $glyph=array_values($glyphs)[$glyph];
53  }
54  }
55  $result->setGlyphicon($glyph);
56  return $result;
57  }
58 }
Composant Twitter Bootstrap Glyphicon.
static getConstants()
Definition: BaseEnum.php:17
static getGlyphicon($glyph)
return an instance of GlyphButton with a glyph defined by string or index
setGlyphicon($glyphicon)
Defines the glyphicon with his name or his index.