PHP Class yii\bootstrap\NavBar

Any content enclosed between the [[begin()]] and [[end()]] calls of NavBar is treated as the content of the navbar. You may use widgets such as Nav or Menu to build up such content. For example, php use yii\bootstrap\NavBar; use yii\bootstrap\Nav; NavBar::begin(['brandLabel' => 'NavBar Test']); echo Nav::widget([ 'items' => [ ['label' => 'Home', 'url' => ['/site/index']], ['label' => 'About', 'url' => ['/site/about']], ], 'options' => ['class' => 'navbar-nav'], ]); NavBar::end();
See also: http://getbootstrap.com/components/#navbar
Since: 2.0
Author: Antonio Ramirez ([email protected])
Author: Alexander Kochetov ([email protected])
Inheritance: extends yii\bootstrap\Widget
Afficher le fichier Open project: yiisoft/yii2-bootstrap Class Usage Examples

Méthodes publiques

Свойство Type Description
$brandLabel the text of the brand or false if it's not used. Note that this is not HTML-encoded.
$brandOptions the HTML attributes of the brand link.
$brandUrl array | string | boolean
$containerOptions the HTML attributes for the container tag. The following special options are recognized: - tag: string, defaults to "div", the name of the container tag.
$innerContainerOptions the HTML attributes of the inner container.
$options the HTML attributes for the widget container tag. The following special options are recognized: - tag: string, defaults to "nav", the name of the container tag.
$renderInnerContainer whether the navbar content should be included in an inner div container which by default adds left and right padding. Set this to false for a 100% width navbar.
$screenReaderToggleText text to show for screen readers for the button to toggle the navbar.

Méthodes publiques

Méthode Description
init ( ) Initializes the widget.
run ( ) Renders the widget.

Méthodes protégées

Méthode Description
renderToggleButton ( ) : string Renders collapsible toggle button.

Method Details

init() public méthode

Initializes the widget.
public init ( )

renderToggleButton() protected méthode

Renders collapsible toggle button.
protected renderToggleButton ( ) : string
Résultat string the rendering toggle button.

run() public méthode

Renders the widget.
public run ( )

Property Details

$brandLabel public_oe property

the text of the brand or false if it's not used. Note that this is not HTML-encoded.
See also: http://getbootstrap.com/components/#navbar
public $brandLabel

$brandOptions public_oe property

the HTML attributes of the brand link.
See also: yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered.
public $brandOptions

$brandUrl public_oe property

public array|string|bool $brandUrl
Résultat array | string | boolean

$containerOptions public_oe property

the HTML attributes for the container tag. The following special options are recognized: - tag: string, defaults to "div", the name of the container tag.
See also: yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered.
public $containerOptions

$innerContainerOptions public_oe property

the HTML attributes of the inner container.
See also: yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered.
public $innerContainerOptions

$options public_oe property

the HTML attributes for the widget container tag. The following special options are recognized: - tag: string, defaults to "nav", the name of the container tag.
See also: yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered.
public $options

$renderInnerContainer public_oe property

whether the navbar content should be included in an inner div container which by default adds left and right padding. Set this to false for a 100% width navbar.
public $renderInnerContainer

$screenReaderToggleText public_oe property

text to show for screen readers for the button to toggle the navbar.
public $screenReaderToggleText