Exemplo 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);
 }
Exemplo n.º 2
0
 public static function activeInput($type, $model, $attribute, $options = [])
 {
     $name = isset($options['name']) ? $options['name'] : Html::getInputName($model, $attribute);
     $value = isset($options['value']) ? $options['value'] : Html::getAttributeValue($model, $attribute);
     if (!array_key_exists('id', $options)) {
         $options['id'] = Html::getInputId($model, $attribute);
     }
     return static::input($type, $name, $value, $options);
 }