Exemplo n.º 1
0
 /**
  * Executes the widget.
  * @return string the result of widget execution to be outputted.
  * @uses [[renderSpinner()]]
  */
 public function run()
 {
     $html[] = Html::beginTag('div', $this->options);
     if ($this->flashColors !== false) {
         foreach ($this->colors as $color) {
             Html::addCssClass($this->spinnerOptions, ['color' => 'spinner-' . $color]);
             $html[] = Html::beginTag('div', $this->spinnerOptions);
             $html[] = $this->renderSpinner();
             $html[] = Html::endTag('div');
             Html::removeCssClass($this->spinnerOptions, ['color' => 'spinner-' . $color]);
         }
     } else {
         $html[] = Html::beginTag('div', $this->spinnerOptions);
         $html[] = $this->renderSpinner();
         $html[] = Html::endTag('div');
     }
     $html[] = Html::endTag('div');
     return implode("\n", $html);
 }