phpMv  -UI toolkit 2.4.12
jQuery, jQuery UI, Twitter Bootstrap and Semantic-UI library for php & php MVC Frameworks
HtmlEmoji.php
Go to the documentation of this file.
1 <?php
2 
4 
6 
7 
17  protected $_emoji;
18 
19  public function __construct($identifier, $emoji) {
20  parent::__construct($identifier, "em", "", NULL);
21  $this->setEmoji($emoji);
22  }
23 
24  public function getEmoji() {
25  return $this->_emoji;
26  }
27 
33  public function setEmoji($emoji) {
34  $emoji=":{$emoji}:";
35  if (isset($this->_emoji)) {
36  $this->removePropertyValue("data-emoji", $this->_emoji);
37  }
38  $this->_emoji=$emoji;
39  $this->addToProperty("data-emoji", $emoji);
40  return $this;
41  }
42 
47  public function asLoader() {
48  return $this->addToProperty("class", "loading");
49  }
50 
57  public function asLink($href=NULL,$target=NULL) {
58  if (isset($href)) {
59  $_target="";
60  if(isset($target))
61  $_target="target='{$target}'";
62  $this->wrap("<a href='" . $href . "' {$_target}>", "</a>");
63  }
64  return $this->addToProperty("class", "link");
65  }
66 
67  public function addLabel($label, $before=false, $emoji=null) {
68  if($before)
69  $this->wrap($label);
70  else
71  $this->wrap("", $label);
72  if($emoji!=null)
73  $this->setEmoji($emoji);
74  return $this;
75  }
76 
77 }
Semantic Emoji component Ajax$HtmlIcon This class is part of phpMv-ui.
Definition: HtmlEmoji.php:16
addToProperty($name, $value, $separator=" ")
__construct($identifier, $emoji)
Definition: HtmlEmoji.php:19
asLink($href=NULL, $target=NULL)
icon formatted as a link
Definition: HtmlEmoji.php:57
addLabel($label, $before=false, $emoji=null)
Definition: HtmlEmoji.php:67
wrap($before, $after="")
Definition: BaseHtml.php:171
asLoader()
Emoji used as a simple loader.
Definition: HtmlEmoji.php:47
Base class for Semantic double elements.
setEmoji($emoji)
sets the emoji
Definition: HtmlEmoji.php:33