Esempio n. 1
0
 /**
  * Renders the opening tag of the field container.
  * @return string the rendering result.
  */
 public function begin()
 {
     $inputID = Html::getInputId($this->model, $this->attribute);
     $options = $this->options;
     $class = isset($options['class']) ? [$options['class']] : [];
     $class[] = "field-{$inputID}";
     $options['class'] = implode(' ', $class);
     $tag = ArrayHelper::remove($options, 'tag', 'div');
     return Html::beginTag($tag, $options);
 }
Esempio n. 2
0
 public static function beginPlugin($name, $options = [])
 {
     if (isset(static::$plugins[$name])) {
         $opts = static::$plugins[$name];
         $tag = ArrayHelper::getValue($opts, 'tag', 'div');
         $clientOptions = ArrayHelper::remove($options, 'clientOptions', []);
         if (!empty($opts['options'])) {
             $clientOptions = ArrayHelper::merge($opts['options'], $clientOptions);
         }
         static::registerPlugin($options, $name, $clientOptions);
         array_push(self::$_states, [$name, $tag]);
         return Html::beginTag($tag, $options);
     }
 }