textInput() public method

This method will generate the name and value tag attributes automatically for the model attribute unless they are explicitly specified in $options.
public textInput ( array $options = [] )
$options array the tag options in terms of name-value pairs. These will be rendered as the attributes of the resulting tag. The values will be HTML-encoded using [[Html::encode()]]. The following special options are recognized: - `maxlength`: int|bool, when `maxlength` is set `true` and the model attribute is validated by a string validator, the `maxlength` option will take the value of [[\yii\validators\StringValidator::max]]. This is available since version 2.0.3. Note that if you set a custom `id` for the input element, you may need to adjust the value of [[selectors]] accordingly.
Exemplo n.º 1
1
 /**
  * @inheritdoc
  */
 public function textInput($options = [])
 {
     $this->options['tag'] = 'md-input-container';
     $options['title'] = $this->model->getAttributeLabel($this->attribute);
     $options['ng-model'] = ArrayHelper::remove($options, 'ng-model', 'data.' . $this->attribute);
     return parent::textInput($options);
 }
Exemplo n.º 2
1
    public function testTextInput()
    {
        $expectedValue = <<<EOD
<input type="text" id="dynamicmodel-attributename" class="form-control" name="DynamicModel[attributeName]">
EOD;
        $this->activeField->textInput();
        $this->assertEquals($expectedValue, $this->activeField->parts['{input}']);
    }
 /**
  * @inheritdoc
  */
 public function textInput($options = [])
 {
     $this->initPlaceholder($options);
     Html::addCssClass($options, $this->addClass);
     $this->initDisability($options);
     return parent::textInput($options);
 }
Exemplo n.º 4
1
 public function timepickerInput($options = [])
 {
     TimePickerAsset::register($this->form->getView());
     $this->registerScript($options);
     return parent::textInput();
 }
Exemplo n.º 5
1
 /**
  * @inheritdoc
  */
 public function textInput($options = [])
 {
     $options = array_merge($this->inputOptions, $options);
     $this->_setWrapperOptions($options);
     $this->_setIconOptions($options);
     $this->_setTooltipOptions($options);
     return parent::textInput($options);
 }
Exemplo n.º 6
0
 public function pickadateInput($options = [])
 {
     PickadateAsset::register($this->form->getView());
     $this->registerScript(!empty($options['clientOptions']) ? $options['clientOptions'] : []);
     return parent::textInput();
 }
Exemplo n.º 7
0
 /**
  * Renders a text input.
  *
  * This method will generate the "name" and "value" tag attributes automatically for the model attribute
  * unless they are explicitly specified in `$options`.
  *
  * @param array $options the tag options in terms of name-value pairs. These will be rendered as
  * the attributes of the resulting tag. The values will be HTML-encoded using [[Html::encode()]].
  * @return static the field object itself
  */
 public function textInput($options = [])
 {
     $this->initPlaceholder($options);
     return parent::textInput($options);
 }
Exemplo n.º 8
0
 /**
  * @inheritdoc
  */
 public function textInput($options = [])
 {
     $options['title'] = $options['placeholder'] = $this->model->getAttributeLabel($this->attribute);
     $options['ng-model'] = 'data.' . $this->attribute;
     return parent::textInput($options);
 }
Exemplo n.º 9
0
 /**
  * @inheritdoc
  */
 public function textInput($options = [])
 {
     Html::addCssClass($this->options, 'form-group--text-input');
     $options = array_merge($this->inputOptions, $options);
     $options['title'] = $this->model->getAttributeLabel($this->attribute);
     $options['ng-model'] = ArrayHelper::remove($options, 'ng-model', sprintf('data.%s', $this->attribute));
     $this->beforeRenderInput(__METHOD__, $options);
     return parent::textInput($options);
 }
 /**
  * @inheritdoc
  */
 public function textInput($options = [])
 {
     Html::addCssClass($options, $this->addClass);
     var_dump($options);
     return parent::textInput($options);
 }