phpMv
-UI toolkit 2.4.12
jQuery, jQuery UI, Twitter Bootstrap and Semantic-UI library for php & php MVC Frameworks
Loading...
Searching...
No Matches
HtmlListgroup.php
Go to the documentation of this file.
1
<?php
2
3
namespace
Ajax\bootstrap\html
;
4
5
use
Ajax\bootstrap\html\base\HtmlBsDoubleElement
;
6
use
Ajax\bootstrap\html\content\HtmlListgroupItem
;
7
14
class
HtmlListgroup
extends
HtmlBsDoubleElement
{
15
16
public
function
__construct
(
$identifier
,
$tagName
=
"ul"
) {
17
parent::__construct(
$identifier
,
$tagName
);
18
$this->content=array ();
19
$this->_template=
'<%tagName% %properties%>%content%</%tagName%>'
;
20
$this->
setProperty
(
"class"
,
"list-group"
);
21
}
22
23
public
function
addItem
($text=
""
) {
24
if
(is_object($text)) {
25
$element=$text;
26
}
else
{
27
switch
($this->tagName) {
28
case
"ul"
:
29
$element=
new
HtmlBsDoubleElement
(
"list-gi-"
.$this->identifier);
30
$element->setTagName(
"li"
);
31
break
;
32
default
:
33
$element=
new
HtmlLink
(
"list-gi-"
.$this->identifier);
34
break
;
35
}
36
$element->setContent($text);
37
}
38
39
$item=
new
HtmlListgroupItem
($element);
40
if
(\is_array($text)) {
41
$item->setHeadingAndContent($text);
42
}
43
$this->content []=$item;
44
return
$item;
45
}
46
47
public
function
addItems
($items) {
48
foreach
( $items as $item ) {
49
if
(is_string($item)) {
50
$this->
addItem
($item);
51
}
else
52
$this->content []=$item;
53
}
54
}
55
56
public
function
getItem
($index) {
57
if
($index<
sizeof
($this->content))
58
return
$this->content [$index];
59
}
60
61
/* (non-PHPdoc)
62
* @see \Ajax\bootstrap\html\base\BaseHtml::fromDatabaseObject()
63
*/
64
public
function
fromDatabaseObject
($object, $function) {
65
$this->
addItem
($function($object));
66
}
67
}
Ajax\bootstrap\html\HtmlLink
Definition
HtmlLink.php:9
Ajax\bootstrap\html\HtmlListgroup
Composant Twitter Bootstrap Listgroup.
Definition
HtmlListgroup.php:14
Ajax\bootstrap\html\HtmlListgroup\__construct
__construct($identifier, $tagName="ul")
Definition
HtmlListgroup.php:16
Ajax\bootstrap\html\HtmlListgroup\getItem
getItem($index)
Definition
HtmlListgroup.php:56
Ajax\bootstrap\html\HtmlListgroup\addItem
addItem($text="")
Definition
HtmlListgroup.php:23
Ajax\bootstrap\html\HtmlListgroup\addItems
addItems($items)
Definition
HtmlListgroup.php:47
Ajax\bootstrap\html\HtmlListgroup\fromDatabaseObject
fromDatabaseObject($object, $function)
Definition
HtmlListgroup.php:64
Ajax\bootstrap\html\base\HtmlBsDoubleElement
Definition
HtmlBsDoubleElement.php:10
Ajax\bootstrap\html\content\HtmlListgroupItem
Inner element for Twitter Bootstrap HTML Listgroup component.
Definition
HtmlListgroupItem.php:19
Ajax\common\html\BaseHtml\$tagName
$tagName
Definition
BaseHtml.php:21
Ajax\common\html\BaseWidget\$identifier
$identifier
Definition
BaseWidget.php:14
Ajax\common\html\traits\BaseHtmlPropertiesTrait\setProperty
setProperty($name, $value)
Definition
BaseHtmlPropertiesTrait.php:30
Ajax\bootstrap\html
Ajax
bootstrap
html
HtmlListgroup.php
Generated on Sun Dec 10 2023 16:15:54 for
phpMv-UI
by
doxygen
1.9.8