phpMv -UI toolkit 2.4.12
jQuery, jQuery UI, Twitter Bootstrap and Semantic-UI library for php & php MVC Frameworks
Loading...
Searching...
No Matches
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}
wrap($before, $after="")
Definition BaseHtml.php:170
Base class for Semantic double elements.
addToProperty($name, $value, $separator=" ")
Semantic Emoji component Ajax\semantic\html\elements$HtmlIcon This class is part of phpMv-ui.
Definition HtmlEmoji.php:16
asLink($href=NULL, $target=NULL)
icon formatted as a link
Definition HtmlEmoji.php:57
asLoader()
Emoji used as a simple loader.
Definition HtmlEmoji.php:47
addLabel($label, $before=false, $emoji=null)
Adds a label to the element.
Definition HtmlEmoji.php:67