chg: [helper:bootstrap] Added support of ID in bsTabs

3.x-ui-sharinggroups
Sami Mokaddem 2023-08-02 11:29:41 +02:00
parent 8551a28302
commit e61a92f11c
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 7 additions and 2 deletions

View File

@ -71,6 +71,7 @@ use App\View\Helper\BootstrapGeneric;
class BootstrapTabs extends BootstrapGeneric
{
private $defaultOptions = [
'id' => '',
'fill-header' => false,
'justify-header' => false,
'pills' => false,
@ -242,10 +243,14 @@ class BootstrapTabs extends BootstrapGeneric
private function genNav(): string
{
$html = $this->nodeOpen('ul', [
$ulOptions = [
'class' => array_merge(['nav'], $this->bsClasses['nav'], $this->options['nav-class']),
'role' => 'tablist',
]);
];
if (!empty($this->options['id'])) {
$ulOptions['id'] = $this->options['id'];
}
$html = $this->nodeOpen('ul', $ulOptions);
foreach ($this->data['navs'] as $navItem) {
$html .= $this->genNavItem($navItem);
}