phpMv
-UI toolkit 2.4.12
jQuery, jQuery UI, Twitter Bootstrap and Semantic-UI library for php & php MVC Frameworks
Loading...
Searching...
No Matches
LabeledIconTrait.php
Go to the documentation of this file.
1
<?php
2
3
namespace
Ajax\semantic\html\base\traits
;
4
5
use
Ajax\semantic\html\elements\HtmlIcon
;
6
use
Ajax\semantic\html\base\constants\Direction
;
7
13
class
LabeledIconTrait
{
14
15
abstract
public
function
addToProperty
($name, $value, $separator=
" "
);
16
abstract
public
function
addContent
($content,$before=
false
);
17
25
public
function
addIcon
($icon,$before=
true
,$labeled=
false
){
26
$iconO=$icon;
27
if
(\is_string($icon)){
28
$iconO=
new
HtmlIcon
(
"icon-"
.$this->identifier, $icon);
29
}
30
if
($labeled!==
false
){
31
$direction=($before===
true
)?
Direction::LEFT
:
Direction::RIGHT
;
32
$this->
addToProperty
(
"class"
, $direction.
" labeled icon"
);
33
$this->tagName=
"div"
;
34
}
35
$this->
addContent
($iconO,$before);
36
return
$iconO;
37
}
38
}
Ajax\semantic\html\base\constants\Direction
Definition
Direction.php:4
Ajax\semantic\html\base\constants\Direction\RIGHT
const RIGHT
Definition
Direction.php:5
Ajax\semantic\html\base\constants\Direction\LEFT
const LEFT
Definition
Direction.php:5
Ajax\semantic\html\base\traits\LabeledIconTrait
Definition
LabeledIconTrait.php:13
Ajax\semantic\html\base\traits\LabeledIconTrait\addIcon
addIcon($icon, $before=true, $labeled=false)
Adds an icon before or after.
Definition
LabeledIconTrait.php:25
Ajax\semantic\html\base\traits\LabeledIconTrait\addToProperty
addToProperty($name, $value, $separator=" ")
Ajax\semantic\html\base\traits\LabeledIconTrait\addContent
addContent($content, $before=false)
Ajax\semantic\html\elements\HtmlIcon
Semantic Icon component.
Definition
HtmlIcon.php:14
Ajax\semantic\html\base\traits
Definition
AttachedTrait.php:3
Ajax
semantic
html
base
traits
LabeledIconTrait.php
Generated on Sun Dec 10 2023 16:16:04 for
phpMv-UI
by
doxygen
1.9.8