Merge pull request #38 from luke-/patch-1

Fixed `homeUrl` in default `homeLink`
This commit is contained in:
simialbi 2022-04-21 08:39:52 +02:00 committed by GitHub
commit 4068a2592f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 2 deletions

View File

@ -12,6 +12,7 @@ Yii Framework 2 bootstrap5 extension Change Log
- Enh #18: Add rangeInput(), colorInput() and switch mode to checkbox() in class ActiveField (WinterSilence) - Enh #18: Add rangeInput(), colorInput() and switch mode to checkbox() in class ActiveField (WinterSilence)
- Bug #19: Fix value of attribute "aria-current" in LinkPager::renderPageButton() (WinterSilence) - Bug #19: Fix value of attribute "aria-current" in LinkPager::renderPageButton() (WinterSilence)
- Bug #23: Fix class attribute in listBox() and dropDownList() of class ActiveField (WinterSilence) - Bug #23: Fix class attribute in listBox() and dropDownList() of class ActiveField (WinterSilence)
- Bug #133: Fix default `homeUrl` in `Breadcrumbs` widget (luke-)
2.0.2 October 21, 2021 2.0.2 October 21, 2021

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);

View File

@ -63,7 +63,7 @@ HTML;
]); ]);
$expected = <<<HTML $expected = <<<HTML
<nav aria-label="breadcrumb"><ol id="w0" class="breadcrumb"><li class="breadcrumb-item"><a href="/">Start</a></li> <nav aria-label="breadcrumb"><ol id="w0" class="breadcrumb"><li class="breadcrumb-item"><a href="/index.php">Start</a></li>
<li class="breadcrumb-item"><a href="#">Library</a></li> <li class="breadcrumb-item"><a href="#">Library</a></li>
<li class="breadcrumb-item active" aria-current="page">Data</li> <li class="breadcrumb-item active" aria-current="page">Data</li>
</ol></nav> </ol></nav>