Barebone\Bootstrap\Grid system

Grid system

Bootstrap includes a responsive, mobile first fluid grid system that appropriately scales up to 12 columns as the device or viewport size increases. It includes predefined classes for easy layout options, as well as powerful mixins for generating more semantic layouts.

You can use any of the HTML elements and add them to the grid.

<?php
    $grid = Barebone\Bootstrap::grid(); // .container
    //$grid = Barebone\Bootstrap::grid()->fluid(); // .container-fluid
    // create row with cells with your own class
    $grid->addRow()
        ->addColumn('.col', ['class' => 'col-xs-12 col-lg-6')
        ->addColumn('.col', ['class' => 'col-xs-12 col-lg-6');
        
    $grid->addRow()
        ->addColumn('.col', ['class' => 'col-xs-12 col-lg-12');
        
    $grid->addRow()
        ->addColumn('.col', ['class' => 'col-xs-12 col-lg-4')
        ->addColumn('.col', ['class' => 'col-xs-12 col-lg-4')
        ->addColumn('.col', ['class' => 'col-xs-12 col-lg-4');
    
    // create row with cells without your own class they get created automatically  
    $grid->addRow()
        ->addColumn('.col')
        ->addColumn('.col')
        ->addColumn('.col')
        ->addColumn('.col')
        ->addColumn('.col')
        ->addColumn('.col');	
    
    // offset    
    $grid->addRow()
        ->addColumn('.col-md-4', ['class' => 'col-md-4')
        ->addColumn('.col-md-4 col-md-offset-4', ['class' => 'col-md-4 col-md-offset-4');
    
    $grid->addRow()
        ->addColumn('.col-md-3 col-md-offset-3', ['class' => 'col-md-3 col-md-offset-3')
        ->addColumn('.col-md-3 col-md-offset-3', ['class' => 'col-md-3 col-md-offset-3');    
    
    
        
    $this->view->grid = ($grid);

Result

.col
.col
.col
.col
.col
.col
.col
.col
.col
.col
.col
.col
.col-md-4
.col-md-4 col-md-offset-4
.col-md-3 col-md-offset-3
.col-md-3 col-md-offset-3





  • Barebone\Bootstrap\Grid

    Barebone\Bootstrap\Grid extends Barebone\Bootstrap\Element
    • [P] $rows : array
    • [M] __construct( array $attributes ) : void
    • [M] fluid() : void
    • [M] addRow() : 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