Esempio n. 1
0
 /**
  * Initializes the widget options
  */
 public function initOptions()
 {
     Ui::addCssClasses($this->options, ['ui', 'message']);
     if (!empty($this->header) && isset($this->header['options'])) {
         Ui::addCssClass($this->header['options'], 'header');
     }
     if (isset($this->icon)) {
         Ui::addCssClass($this->options, 'icon');
     }
 }
Esempio n. 2
0
 /**
  * Renders a step element item @see http://semantic-ui.com/elements/step.html
  *
  * @param string $content the content of the item
  * @param array $options the tag options in terms of name-value pairs
  *
  * @return string the generated step item tag
  */
 public static function step($content, $options = [])
 {
     Ui::addCssClass($options, 'step');
     $tag = ArrayHelper::remove($options, 'tag', 'div');
     return Ui::tag($tag, $content, $options);
 }
Esempio n. 3
0
 /**
  * Renders the configured sides
  *
  * @param array $sides @see $sides
  *
  * @return string the generated shape sides
  * @throws InvalidConfigException
  */
 protected function renderSides($sides)
 {
     $lines = [];
     $lines[] = Html::beginTag('div', $this->sidesOptions);
     foreach ($sides as $side) {
         if (!array_key_exists('content', $side)) {
             throw new InvalidConfigException("The 'content' option is required per sides");
         }
         $options = ArrayHelper::getValue($side, 'options', []);
         Ui::addCssClass($options, 'side');
         $active = ArrayHelper::getValue($side, 'active', false);
         if ($active === true) {
             Ui::addCssClass($options, 'active');
         }
         $lines[] = Html::tag('div', $side['content'], $options);
     }
     $lines[] = Html::endTag('div');
     return implode("\n", $lines);
 }