Example:
~~~
echo Html::listGroup([
[
'content' => 'Cras justo odio',
'url' => '#',
'badge' => '14',
'active' => true
],
[
'content' => 'Dapibus ac facilisis in',
'url' => '#',
'badge' => '2'
],
[
'content' => 'Morbi leo risus',
'url' => '#',
'badge' => '1'
],
]);
echo Html::listGroup([
[
'content' => ['heading' => 'Heading 1', 'body' => 'Cras justo odio'],
'url' => '#',
'badge' => '14',
'active' => true
],
[
'content' => ['heading' => 'Heading 2', 'body' => 'Dapibus ac facilisis in'],
'url' => '#',
'badge' => '2'
],
[
'content' => ['heading' => 'Heading 2', 'body' => 'Morbi leo risus'],
'url' => '#',
'badge' => '1'
],
]);
~~~
public static listGroup ( array $items = [], array $options = [], string $tag = 'div', string $itemTag = 'div' ) : string | ||
$items | array | the list group items. The following array key properties can be setup: - `content`: mixed, the list item content. When passed as a string, it will display this directly as a raw content. When passed as an array, it requires these keys - `heading`: _string_, the content heading (optional). - `headingOptions`: _array_, the HTML attributes / options for heading container (optional). - `body`: _string_, the content body (optional). - `bodyOptions`: _array_, the HTML attributes / options for body container (optional). - `url`: _string_|_array_, the url for linking the list item content (optional). - `badge`: _string_, any badge content to be displayed for this list item (optional) - `badgeOptions`: _array_, the HTML attributes / options for badge container (optional). - `active`: _boolean_, to highlight the item as active (applicable only if $url is passed). Defaults to `false`. - `options`: _array_, HTML attributes / options for the list group item container (optional). |
$options | array | HTML attributes / options for the list group container |
$tag | string | the list group container tag. Defaults to 'div'. |
$itemTag | string | the list item container tag. Defaults to 'div'. |
Résultat | string |