Class TopBar
TopBar widget renders a nav HTML component.
For example:
echo TopBar::widget(array( 'leftItems' => array( array( 'label' => 'Home', 'url' => '/', 'linkOptions' => array(...), 'active' => true, ), array( 'label' => 'Dropdown', 'items' => array( array( 'label' => 'Dropdown item A', 'url' => '#', ), array( 'label' => 'Dropdown item B', 'url' => '#', ), ), ), ), 'rightItems' => array( array( 'label' => 'I am at right', 'url' => '/', 'linkOptions' => array(...), 'active' => true, ), array( 'label' => 'Dropdown', 'items' => array( array( 'label' => 'Dropdown item A', 'url' => '#', ), array( 'label' => 'Dropdown item B', 'url' => '#', ), ), ), ), ));
- CWidget
- foundation\widgets\base\Widget
- foundation\widgets\TopBar
Package: foundation\widgets
Author: Antonio Ramirez <amigo.cobos@gmail.com>
Located at widgets/TopBar.php
Methods summary
public
|
|
public
|
|
protected
|
|
protected
string
|
|
protected
string
|
|
protected
string
|
Methods inherited from foundation\widgets\base\Widget
display()
,
registerAssets()
,
registerEvents()
,
registerPlugin()
Magic methods summary
Properties summary
public
string
|
$title |
#
$title the menu title |
public
string
|
$titleUrl |
#
$titleUrl the menu url |
public
array
|
$titleOptions |
#
$titleOptions the HTML-attributes of the title |
public
array
|
$leftItems |
#
list of left menu items in the topbar widget. Each array element represents a single menu item with the following structure:
|
public
array
|
$rightItems |
#
list of right menu items in the topbar widget. Each array element represents a single menu item with the following structure:
|
public
boolean
|
$encodeLabels |
#
whether the left|right items should be HTML-encoded |
public
boolean
|
$fixed |
#
whether to make the bar fixed or not |
public
boolean
|
$containToGrid |
#
whether to make the top bar contained to grid. |
public
boolean
|
$sticky |
#
whether to make the top bar sticky. Sticky means that when the navigation its the top of the browser, it will act like the fixed top bar and stick to the top as users continue to scroll. |
protected
array
|
$wrapperOptions |
#
the HTML-attributes of the layer wrapping the nav tag. If empty, the wrapper wont be displayed. |