phpMv -UI toolkit 2.4.12
jQuery, jQuery UI, Twitter Bootstrap and Semantic-UI library for php & php MVC Frameworks
Loading...
Searching...
No Matches
HtmlLabel.php
Go to the documentation of this file.
1<?php
2
4
12
21
22 public function __construct($identifier, $caption="", $icon=NULL, $tagName="div") {
23 parent::__construct($identifier, $tagName, "ui label");
24 $this->content=$caption;
25 if (isset($icon))
26 $this->addIcon($icon);
27 }
28
34 public function setPointing($value=Direction::NONE) {
35 if($value==="left" || $value==="right")
36 return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing"));
37 else
38 return $this->addToPropertyCtrl("class", "pointing ".$value, Direction::getConstantValues("pointing",true));
39 }
40
46 public function toCorner($side="left") {
47 return $this->addToPropertyCtrl("class", $side . " corner", array ("right corner","left corner" ));
48 }
49
50 public function setHorizontal(){
51 return $this->addToPropertyCtrl("class", "hozizontal",array("horizontal"));
52 }
53
54 public function setFloating(){
55 return $this->addToPropertyCtrl("class", "floating",array("floating"));
56 }
57
62 public function asTag() {
63 return $this->addToProperty("class", "tag");
64 }
65
66 public function setEmpty(){
67 $this->content=NULL;
68 return $this->addToPropertyCtrl("class", "empty",array("empty"));
69 }
70
71 public function setBasic() {
72 return $this->addToProperty("class", "basic");
73 }
74
82 public function addEmphasisImage($src, $alt="", $before=true) {
83 $this->addToProperty("class", "image");
84 return $this->addImage($src,$alt,$before);
85 }
86
94 public function addAvatarImage($src, $alt="", $before=true) {
95 $img=$this->addImage($src,$alt,$before);
96 $img->setClass("ui image");
97 $img->asAvatar();
98 return $img;
99 }
100
108 public function addImage($src, $alt="", $before=true) {
109 $img=new HtmlImg("image-" . $this->identifier, $src, $alt);
110 $img->setClass("");
111 $this->addContent($img, $before);
112 return $img;
113 }
114
120 public function addDetail($detail) {
121 $div=new HtmlSemDoubleElement("detail-" . $this->identifier, $this->tagName,"detail");
122 $div->setContent($detail);
123 $this->addContent($div);
124 return $div;
125 }
126
131 public function asRibbon($direction=Direction::NONE) {
132 return $this->addToPropertyCtrl("class", $direction." ribbon", array ("ribbon","right ribbon","left ribbon" ));
133 }
134
135 public function setAttached($side=Side::TOP,$direction=Direction::NONE){
136 if($direction!==Direction::NONE)
137 return $this->addToPropertyCtrl("class", $side." ".$direction." attached",Side::getConstantValues($direction." attached"));
138 else
139 return $this->addToPropertyCtrl("class", $side." attached",Side::getConstantValues("attached"));
140 }
141
148 public static function ribbon($identifier, $caption,$direction=Direction::NONE) {
149 return (new HtmlLabel($identifier, $caption))->asRibbon($direction);
150 }
151
157 public static function tag($identifier, $caption) {
158 return (new HtmlLabel($identifier, $caption))->asTag();
159 }
160}
Base class for Semantic double elements.
addToPropertyCtrl($name, $value, $typeCtrl)
addIcon($icon, $before=true, $labeled=false)
Adds an icon before or after.
addToProperty($name, $value, $separator=" ")
Semantic Label component.
Definition HtmlLabel.php:20
setPointing($value=Direction::NONE)
Definition HtmlLabel.php:34
addImage($src, $alt="", $before=true)
Adds an image.
__construct($identifier, $caption="", $icon=NULL, $tagName="div")
Definition HtmlLabel.php:22
addEmphasisImage($src, $alt="", $before=true)
Adds an image to emphasize.
Definition HtmlLabel.php:82
static ribbon($identifier, $caption, $direction=Direction::NONE)
static tag($identifier, $caption)
setAttached($side=Side::TOP, $direction=Direction::NONE)
addAvatarImage($src, $alt="", $before=true)
Adds an avatar image.
Definition HtmlLabel.php:94
asRibbon($direction=Direction::NONE)