Barebone\Bootstrap\Progress

Basic example

Default progress bar.

<?php
    $progress = new Barebone\Bootstrap\Progress(60);
    echo $progress;

Result

60% Complete
<div class="progress">
<div class="progress-bar" style="width:60%" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100">
<span class="sr-only">60% Complete</span>
</div>
</div>

With label

$progress->show_label();

Removes the .sr-only class from within the progress bar to show a visible percentage.

<?php
    $progress2 = new Barebone\Bootstrap\Progress(80, 0, 100);
    echo $progress2->show_label();

Result

80% Complete
<div class="progress">
<div class="progress-bar" style="width:80%" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100">
<span>80% Complete</span>
</div>
</div>

Contextual alternatives

Progress bars use some of the same button and alert classes for consistent styles.

<?php
    $progress2 = new Barebone\Bootstrap\Progress(20, 0, 100, 'success');
    echo $progress2->show_label();
    $progress2 = new Barebone\Bootstrap\Progress(40, 0, 100, 'Warning');
    echo $progress2->show_label();
    $progress2 = new Barebone\Bootstrap\Progress(60, 0, 100, 'Danger');
    echo $progress2->show_label();
    $progress2 = new Barebone\Bootstrap\Progress(80, 0, 100, 'Info');
    echo $progress2->show_label();

Result

20% Complete
40% Complete
60% Complete
80% Complete

Striped

Uses a gradient to create a striped effect. Not available in IE8.

<?php
    $progress = new Barebone\Bootstrap\Progress(20, 0, 100, 'success');
    echo $progress->striped();
    $progress = new Barebone\Bootstrap\Progress(40, 0, 100, 'warning');
    echo $progress->striped();
    $progress = new Barebone\Bootstrap\Progress(60, 0, 100, 'danger');
    echo $progress->striped();
    $progress = new Barebone\Bootstrap\Progress(80, 0, 100, 'info');
    echo $progress->striped()->show_label(); // with label mixed

Result

20% Complete
40% Complete
60% Complete
80% Complete

Animated

Adds .active to .progress-striped to animate the stripes right to left. Not available in IE9 and below.

<?php
    $progress = new Barebone\Bootstrap\Progress(20, 0, 100, 'success');
    echo $progress->animated();
    $progress = new Barebone\Bootstrap\Progress(40, 0, 100, 'warning');
    echo $progress->animated();
    $progress = new Barebone\Bootstrap\Progress(60, 0, 100, 'danger');
    echo $progress->animated();
    $progress = new Barebone\Bootstrap\Progress(80, 0, 100, 'info');
    echo $progress->animated()->show_label(); // with label mixed

Result

20% Complete
40% Complete
60% Complete
80% Complete
  • Barebone\Bootstrap\Progress

    Barebone\Bootstrap\Progress extends Barebone\Bootstrap\Element
    • [P] $value : mixed
    • [P] $valuemin : mixed
    • [P] $valuemax : mixed
    • [P] $complete : Barebone\HTML\TElement
    • [M] __construct( $value, $valuemin, $valuemax, $contextual ) : void
    • [M] show_label() : void
    • [M] striped() : void
    • [M] animated() : 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