phpMv
-UI toolkit 2.4.12
jQuery, jQuery UI, Twitter Bootstrap and Semantic-UI library for php & php MVC Frameworks
Loading...
Searching...
No Matches
HtmlIconGroups.php
Go to the documentation of this file.
1
<?php
2
3
namespace
Ajax\semantic\html\elements
;
4
5
use
Ajax\semantic\html\base\HtmlSemCollection
;
6
use
Ajax\service\JArray
;
7
use
Ajax\JsUtils
;
8
16
class
HtmlIconGroups
extends
HtmlSemCollection
{
17
18
public
function
__construct
(
$identifier
, $icons=array(), $size=
""
) {
19
parent::__construct(
$identifier
,
"i"
,
"icons"
);
20
$this->
addItems
($icons);
21
$this->
setSize
($size);
22
}
23
27
public
function
getItem
($index){
28
return
parent::getItem($index);
29
}
30
31
protected
function
createItem
($value) {
32
$icon=$value;
33
if
(\is_array($value)) {
34
$icon=JArray::getValue($value,
"icon"
, 0);
35
$size=JArray::getValue($value,
"size"
, 1);
36
}
37
$iconO=
new
HtmlIcon
(
"icon-"
. $this->identifier, $icon);
38
if
(isset($size)) {
39
$iconO->setSize($size);
40
}
41
return
$iconO;
42
}
43
44
protected
function
createCondition
($value) {
45
return
($value instanceof
HtmlIcon
) ===
false
;
46
}
47
48
public
function
getIcon
($index) {
49
return
$this->content[$index];
50
}
51
52
public
function
run
(
JsUtils
$js){
53
$result= parent::run($js);
54
return
$result->setItemSelector(
"i"
);
55
}
56
57
public
function
toCorner
($index=1) {
58
$this->
getItem
($index)->toCorner();
59
return
$this;
60
}
61
62
public
static
function
corner
($mainIcon,$cornerIcon,$size=
"huge"
){
63
$icons=
new
HtmlIconGroups
(
"icons"
,[$mainIcon,$cornerIcon],$size);
64
return
$icons->toCorner(1);
65
}
66
}
Ajax\JsUtils
JQuery PHP library.
Definition
JsUtils.php:23
Ajax\common\html\BaseWidget\$identifier
$identifier
Definition
BaseWidget.php:14
Ajax\common\html\HtmlCollection\addItems
addItems($items)
Definition
HtmlCollection.php:22
Ajax\semantic\html\base\HtmlSemCollection
Base class for Semantic Html collections.
Definition
HtmlSemCollection.php:13
Ajax\semantic\html\base\traits\BaseTrait\setSize
setSize($size)
Definition
BaseTrait.php:107
Ajax\semantic\html\elements\HtmlIconGroups
Semantic Icons group component.
Definition
HtmlIconGroups.php:16
Ajax\semantic\html\elements\HtmlIconGroups\__construct
__construct($identifier, $icons=array(), $size="")
Definition
HtmlIconGroups.php:18
Ajax\semantic\html\elements\HtmlIconGroups\run
run(JsUtils $js)
SimpleExtComponent\Ajax\common\html\BaseHtmlrun()\Ajax\common\html\BaseHtmlrun()\Ajax\common\html\Bas...
Definition
HtmlIconGroups.php:52
Ajax\semantic\html\elements\HtmlIconGroups\getIcon
getIcon($index)
Definition
HtmlIconGroups.php:48
Ajax\semantic\html\elements\HtmlIconGroups\createCondition
createCondition($value)
Definition
HtmlIconGroups.php:44
Ajax\semantic\html\elements\HtmlIconGroups\createItem
createItem($value)
The item factory.
Definition
HtmlIconGroups.php:31
Ajax\semantic\html\elements\HtmlIconGroups\toCorner
toCorner($index=1)
Definition
HtmlIconGroups.php:57
Ajax\semantic\html\elements\HtmlIconGroups\getItem
getItem($index)
Definition
HtmlIconGroups.php:27
Ajax\semantic\html\elements\HtmlIconGroups\corner
static corner($mainIcon, $cornerIcon, $size="huge")
Definition
HtmlIconGroups.php:62
Ajax\semantic\html\elements\HtmlIcon
Semantic Icon component.
Definition
HtmlIcon.php:14
Ajax\service\JArray
Definition
JArray.php:4
Ajax\semantic\html\elements
Ajax
semantic
html
elements
HtmlIconGroups.php
Generated on Sun Dec 10 2023 16:16:07 for
phpMv-UI
by
doxygen
1.9.8