yiisoft / yii-bootstrap5

Yii Framework Bootstrap 5 support
https://www.yiiframework.com/
BSD 3-Clause "New" or "Revised" License
63 stars 19 forks source link

["homeLink" => false] parameter does not work anymore #58

Closed mark469 closed 3 years ago

mark469 commented 3 years ago

What steps will reproduce the problem?

Create a new instance of the breadcrumbs widget

<?= Breadcrumbs::widget([                                   
    'homeLink' => false,
    'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [],
]) ?>

What is the expected result?

The home link should not be rendered

What do you get instead?

TypeError
Argument 1 passed to yii\bootstrap5\Breadcrumbs::renderItem() must be of the type array, bool given

Additional info

Q A
Version 1.0.?
PHP version 7.4.3
Operating system Windows 10 WSL ubuntu
terabytesoftw commented 3 years ago

Use:

<?= Breadcrumbs::widget([                                   
    'homeLink' => [],
    'links' => $this->params['breadcrumbs'] ?? [],
]) ?>

After merge.