TbHtml::progressBar PHP Method

progressBar() public static method

Generates a progress bar.
public static progressBar ( integer $width, array $htmlOptions = [] ) : string
$width integer the progress in percent.
$htmlOptions array additional HTML attributes.
return string the generated progress bar.
    public static function progressBar($width = 0, $htmlOptions = array())
    {
        self::addCssClass('progress', $htmlOptions);
        if (TbArray::popValue('striped', $htmlOptions, false)) {
            self::addCssClass('progress-striped', $htmlOptions);
        }
        if (TbArray::popValue('animated', $htmlOptions, false)) {
            self::addCssClass('active', $htmlOptions);
        }
        $barOptions = TbArray::popValue('barOptions', $htmlOptions, array());
        $color = TbArray::popValue('color', $htmlOptions);
        if (!empty($color)) {
            $barOptions['color'] = $color;
        }
        $content = TbArray::popValue('content', $htmlOptions);
        if (!empty($content)) {
            $barOptions['content'] = $content;
        }
        $content = self::bar($width, $barOptions);
        return self::tag('div', $htmlOptions, $content);
    }

Usage Example

Example #1
0
</section>


<!-- Progress bars
	================================================== -->
<section id="progress">

	<div class="page-header">
		<h1>Progress bars <small>For loading, redirecting, or action status</small></h1>
	</div>

	<h3>Basic</h3>

	<div class="bs-docs-example">
		<?php 
echo TbHtml::progressBar(60);
?>
	</div>
	<pre class="prettyprint linenums">
&lt;?php echo TbHtml::progressBar(60); ?></pre>

	<h3>Striped</h3>

	<div class="bs-docs-example">
		<?php 
echo TbHtml::stripedProgressBar(20);
?>
	</div>
	<pre class="prettyprint linenums">
&lt;?php echo TbHtml::stripedProgressBar(20); ?></pre>
All Usage Examples Of TbHtml::progressBar
TbHtml