chg: [helper:bootstrap] Added support of badge in dropdown menu entries

pull/93/head
Sami Mokaddem 2021-11-10 08:54:43 +01:00
parent 04ad3be4a6
commit 69f8375422
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 6 additions and 1 deletions

View File

@ -1883,6 +1883,11 @@ class BoostrapDropdownMenu extends BootstrapGeneric
if (!empty($entry['icon'])) {
$icon = $this->btHelper->icon($entry['icon']);
}
$badge = '';
if (!empty($entry['badge'])) {
$bsBadge = new BoostrapBadge($entry['badge']);
$badge = $bsBadge->badge();
}
if (!empty($entry['menu'])) {
$classes[] = 'dropdown-toggle';
@ -1898,7 +1903,7 @@ class BoostrapDropdownMenu extends BootstrapGeneric
$label = $this->genNode('span', [
'class' => ['ms-2',],
], h($entry['text']));
$content = $icon . $label;
$content = $icon . $label . $badge;
return $this->genNode('a', array_merge([
'class' => $classes,