Fixed homeUrl in default homeLink

The Phpdoc descriptions says "If this property is not set, it will default to a link pointing to [[\yii\web\Application::homeUrl]] with the label 'Home'. If this property is false, the home link will not be rendered."
This commit is contained in:
Lucas Bartholemy 2022-04-20 19:17:51 +02:00 committed by GitHub
parent f7e2942960
commit 6645e88574
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -111,7 +111,7 @@ class Breadcrumbs extends Widget
if ($this->homeLink === []) { if ($this->homeLink === []) {
$links[] = $this->renderItem([ $links[] = $this->renderItem([
'label' => Yii::t('yii/bootstrap5', 'Home'), 'label' => Yii::t('yii/bootstrap5', 'Home'),
'url' => '/', 'url' => Yii::$app->homeUrl,
], $this->itemTemplate); ], $this->itemTemplate);
} elseif ($this->homeLink !== false) { } elseif ($this->homeLink !== false) {
$links[] = $this->renderItem($this->homeLink, $this->itemTemplate); $links[] = $this->renderItem($this->homeLink, $this->itemTemplate);