Nav: Lists See documentation
Creates a default navigation list:
$list = Html::navlist() $list->item('#', 'One') $list->item('#', 'Two') echo $list;
Add a
header
an a divider
into the list:
$list->header('Common tasks'); $list->item('#', 'One'); $list->divider(); $list->item('#', 'Two');
Activate
an item:
$list->item('#', 'One')->active() // or $list->item('#', 'One', array('active' => true))
Disable
an item:
$list->item('#', 'One')->disabled() // or $list->item('#', 'One', array('disabled' => true))
Setup
icon
for items:
$list->item('#', 'One', array('icon' => 'user')); $list->item('#', 'Two', array('icon' => 'fire'));
Nested lists
There is no deepness limitations while nesting list. Take note that lists are not aware to be nested, so there is no specific css markup generated.
Use decendent selectors to apply style to your lists.
item
. The list will be appened after the list anchor:
$list1 = Html::navlist(); $list1->item('#', 'One'); $list1->item('#', 'Two'); $list2 = Html::navlist(); $list2->item('#', 'Sub one'); $list2->item('#', 'Sub two', array('active' => true))->nest($list);
Nest an existing navlist instance whithin the
navlist
. It will creates a new entry, containing the nested list:
$list2->nest($list1)
The nest() method returns the nested list. If you nest don't nest an instance of Navlist, it will creates a new instance:
$nested = $list2->nest(array('class' => 'sub-nav')) $nested->item('#', 'nested')