|
|
|
@ -7,6 +7,7 @@
|
|
|
|
|
|
|
|
|
|
namespace yii\bootstrap; |
|
|
|
|
|
|
|
|
|
use Yii; |
|
|
|
|
use yii\helpers\Html; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -43,9 +44,9 @@ class NavBar extends Widget
|
|
|
|
|
public $brandLabel; |
|
|
|
|
/** |
|
|
|
|
* @param array|string $url the URL for the brand's hyperlink tag. This parameter will be processed by [[Html::url()]] |
|
|
|
|
* and will be used for the "href" attribute of the brand link. Defaults to site root. |
|
|
|
|
* and will be used for the "href" attribute of the brand link. If not set, [[\yii\web\Application::homeUrl]] will be used. |
|
|
|
|
*/ |
|
|
|
|
public $brandUrl = '/'; |
|
|
|
|
public $brandUrl; |
|
|
|
|
/** |
|
|
|
|
* @var array the HTML attributes of the brand link. |
|
|
|
|
*/ |
|
|
|
@ -84,7 +85,7 @@ class NavBar extends Widget
|
|
|
|
|
echo Html::beginTag('div', ['class' => 'navbar-header']); |
|
|
|
|
echo $this->renderToggleButton(); |
|
|
|
|
if ($this->brandLabel !== null) { |
|
|
|
|
echo Html::a($this->brandLabel, $this->brandUrl, $this->brandOptions); |
|
|
|
|
echo Html::a($this->brandLabel, $this->brandUrl === null ? Yii::$app->homeUrl : $this->brandUrl, $this->brandOptions); |
|
|
|
|
} |
|
|
|
|
echo Html::endTag('div'); |
|
|
|
|
|
|
|
|
|