public function progress($widths, $options = [])
{
$options += ['striped' => false, 'active' => false, 'format' => $this->config('progressTextFormat')];
$striped = $options['striped'];
$active = $options['active'];
unset($options['active'], $options['striped']);
$bars = '';
if (!is_array($widths)) {
$widths = [array_merge(['width' => $widths], $options)];
}
foreach ($widths as $width) {
$width += ['type' => $this->config('progress.type'), 'min' => 0, 'max' => 100, 'display' => false];
$class = 'progress-bar progress-bar-' . $width['type'];
$content = $this->tag('span', sprintf($options['format'], $width['width']), ['class' => $width['display'] ? '' : 'sr-only']);
$bars .= $this->div($class, $content, ['aria-valuenow' => $width['width'], 'aria-valuemin' => $width['min'], 'aria-valuemax' => $width['max'], 'role' => 'progressbar', 'style' => 'width: ' . $width['width'] . '%;']);
}
$options = $this->addClass($options, 'progress');
if ($active) {
$options = $this->addClass($options, 'active');
}
if ($striped) {
$options = $this->addClass($options, 'progress-striped');
}
$classes = $options['class'];
unset($options['class'], $options['active'], $options['type'], $options['striped'], $options['format']);
return $this->div($classes, $bars, $options);
}