duanleiming2014 2018-05-28 12:54
浏览 19
已采纳

在Yii2 Breadcrumbs小部件中更改主文本和URL

I want to change default text "Home" and also the URL for home. While searching on it I found suggestion that need to set homeUrl but I don't have any idea where to set it. Please ask for code if you need it.

  • 写回答

1条回答 默认 最新

  • dongshen5115 2018-05-28 12:59
    关注

    You need to configure $homeLink property:

    echo Breadcrumbs::widget([
        'homeLink' => [
            'label' => 'My name',
            'url' => '/my/url',
        ],
        'links' => [
            // your items
        ],
        // rest of widget config
    ]);
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?