yiisoft / yii2-app-basic

Yii 2.0 Basic Application Template

Home Page:http://www.yiiframework.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

yii\bootstrap5\Navbar collapseOptions

paulstorre opened this issue · comments

commented

What steps will reproduce the problem?

NavBar::begin([
     'collapseOptions'=> false
]);

// content

NavBar::end();

What's expected?

Expecting rendered Bootstrap 5 navigation bar

What do you get instead?

yii\base\ErrorException

vendor/yiisoft/yii2-bootstrap5/src/NavBar.php at line 219

if ($this->offcanvasOptions !== false) {
    $bsData = ['bs-toggle' => 'offcanvas', 'bs-target' => '#' . $this->offcanvasOptions['id']];
    $aria = $this->offcanvasOptions['id'];
} else {
    // Trying to access array offset on false
    $bsData = ['bs-toggle' => 'collapse', 'bs-target' => '#' . $this->collapseOptions['id']];
    $aria = $this->collapseOptions['id'];
}

Additional info

Q A
Yii version 2.0.49.3
PHP version 8.3.2
Operating system macOS