Barebone\Bootstrap\Navs

Nav\Tabs

<?php
    $nav = new Barebone\Bootstrap\Nav();
    $nav->tabs();
    $nav->addItem('Home', '/', true);
    $nav->addItem('Contact', '/contact/');
    $nav->addItem('Messages', '/messages/');
    echo $nav;
<ul class="nav nav-tabs">
<li class="active">
<a href="/">Home</a>
</li>
<li>
<a href="/contact/">Contact</a>
</li>
<li>
<a href="/messages/">Messages</a>
</li>
</ul>

Nav\Pills

<?php
    $nav = new Barebone\Bootstrap\Nav();
    $nav->pills();
    $nav->addItem('Home', '/', true);
    $nav->addItem('Contact', '/contact/');
    $nav->addItem('Messages', '/messages/');
    echo $nav;
<ul class="nav nav-pills">
<li class="active">
<a href="/">Home</a>
</li>
<li>
<a href="/contact/">Contact</a>
</li>
<li>
<a href="/messages/">Messages</a>
</li>
</ul>

Nav\Pills (stacked)

Pills are also vertically stackable. Just add $nav->stacked().

<?php
    $nav = new Barebone\Bootstrap\Nav();
    $nav->pills();
    $nav->stacked();
    $nav->addItem('Home', '/', true);
    $nav->addItem('Contact', '/contact/');
    $nav->addItem('Messages', '/messages/');
    echo $nav;
<ul class="nav nav-pills nav-stacked">
<li class="active">
<a href="/">Home</a>
</li>
<li>
<a href="/contact/">Contact</a>
</li>
<li>
<a href="/messages/">Messages</a>
</li>
</ul>

Justified

Easily make tabs or pills equal widths of their parent at screens wider than 768px with Just add $nav->justified(). On smaller screens, the nav links are stacked.

<?php
    $nav = new Barebone\Bootstrap\Nav();
    $nav->pills();
    $nav->justified();
    $nav->addItem('Home', '/', true);
    $nav->addItem('Contact', '/contact/');
    $nav->addItem('Messages', '/messages/');
    echo $nav;
<ul class="nav nav-pills nav-justified">
<li class="active">
<a href="/">Home</a>
</li>
<li>
<a href="/contact/">Contact</a>
</li>
<li>
<a href="/messages/">Messages</a>
</li>
</ul>
  • Barebone\Bootstrap\Nav

    Barebone\Bootstrap\Nav extends Barebone\Bootstrap\Element
    • [M] __construct() : void
    • [M] tabs() : void
    • [M] pills() : void
    • [M] stacked() : void
    • [M] justified() : void
    • [M] addItem( $caption, $href, $active, $badge ) : void
    • [M] addForm( Barebone\Bootstrap\Form $form ) : void
    • [M] addDropDown( $caption, $items ) : void
    • Barebone\Bootstrap\Element

      Barebone\Bootstrap\Element extends Barebone\HTML\TElement
      • [M] __construct( string $tag, array $attributtes ) : void
      • [M] muted( string $context ) : void
        ↳ trait: Barebone\Bootstrap\Traits\Contextual
      • [M] primary( string $context ) : void
        ↳ trait: Barebone\Bootstrap\Traits\Contextual
      • [M] success( string $context ) : void
        ↳ trait: Barebone\Bootstrap\Traits\Contextual
      • [M] info( string $context ) : void
        ↳ trait: Barebone\Bootstrap\Traits\Contextual
      • [M] warning( string $context ) : void
        ↳ trait: Barebone\Bootstrap\Traits\Contextual
      • [M] danger( string $context ) : void
        ↳ trait: Barebone\Bootstrap\Traits\Contextual
      • [M] align( string $alignement ) : void
        ↳ trait: Barebone\Bootstrap\Traits\Visibility
      • [M] invisible() : void
        ↳ trait: Barebone\Bootstrap\Traits\Visibility
      • [M] hide() : void
        ↳ trait: Barebone\Bootstrap\Traits\Visibility
      • [M] show() : void
        ↳ trait: Barebone\Bootstrap\Traits\Visibility
      • [M] tooltip( string $tooltip, string $placement ) : void
        ↳ trait: Barebone\Bootstrap\Traits\Interactive
      • [M] popover( string $title, string $content, string $placement ) : void
        ↳ trait: Barebone\Bootstrap\Traits\Interactive
      • Barebone\HTML\TElement

        Barebone\HTML\TElement
        • [P] $tag : string
        • [P] $innertext : string
        • [P] $children : array
        • [P] $attributes : array
        • [P] $non_closing_tags : mixed
        • [M] __construct( string $tag, array $attributes ) : void
        • [M] append( Barebone\HTML\TElement $element ) : void
        • [M] prepend( Barebone\HTML\TElement $element ) : void
        • [M] class_exists( $cssclass ) : void
        • [M] add_class( $cssclass ) : void
        • [M] remove_class( $cssclass ) : void
        • [M] innertext( string $value ) : void
        • [M] data( string $name, string $value ) : void
        • [M] aria( string $name, string $value ) : void
        • [M] on( string $event, string $callback ) : void
        • [M] css( string $identifier, string $rule ) : void
        • [M] wrap( string $tagname, array $attributes ) : void
        • [M] enable() : void
        • [M] disable() : void
        • [M] has_closing_tag() : void
        • [M] has_children() : void
        • [M] count_children() : void
        • [M] get_children() : void
        • [M] replace_child( $key, $new_child ) : void
        • [M] get_child( $key ) : void
        • [M] __unset( $name ) : void
        • [M] __isset( $name ) : void
        • [M] __set( $name, $value ) : void
        • [M] __get( $name ) : void
        • [M] render() : void
        • [M] __toString() : string
        • [M] editable() : void