Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yii\bootstrap5\Navbar collapseOptions #312

Open
paulstorre opened this issue Mar 13, 2024 · 0 comments
Open

yii\bootstrap5\Navbar collapseOptions #312

paulstorre opened this issue Mar 13, 2024 · 0 comments

Comments

@paulstorre
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant