Generates a number field for a model attribute.
@param CModel $model the data model.
@param string $attribute the attribute.
@param array $htmlOptions additional HTML attributes.
@return string the generated input field.
@see TbHtml::activeNumberField
3758
public function numberField($model, $attribute, $htmlOptions = array())
    {
        return $this->createInput(TbHtml::INPUT_TYPE_NUMBER, $model, $attribute, $htmlOptions);
    }
421588
public function resolveModelAttribute($model, $attribute = null)
    {
        if ($attribute === null) {
            $attribute = $this->valueFrom ?: $this->fieldName;
        }

        $parts = is_array($attribute) ? $attribute : HtmlHelper::nameToArray($attribute);
        $last = array_pop($parts);

        foreach ($parts as $part) {
            $model = $model->{$part};
        }

        return [$model, $last];
    }
1300893
protected function parseTagAttributeValue(AttributeHandler $tagAttribute, AbstractModel $model)
    {
        if (!$model instanceof StructValue) {
            $model->addMeta($tagAttribute->getName(), $tagAttribute->getValue(true));
        }
    }
1154807
public function renderField(Model $model, $attribute, array $settings = [])
    {
        $fieldOptions = ArrayHelper::getValue($settings, 'fieldOptions', []);
        $field = $this->field($model, $attribute, $fieldOptions);

        if (($label = ArrayHelper::getValue($settings, 'label')) !== null) {
            $field->label($label, ArrayHelper::getValue($settings, 'labelOptions', []));
        }
        if (($hint = ArrayHelper::getValue($settings, 'hint')) !== null) {
            $field->hint($hint, ArrayHelper::getValue($settings, 'hintOptions', []));
        }

        $type = ArrayHelper::getValue($settings, 'type', static::INPUT_TEXT);
        $this->prepareField($field, $type, $settings);

        return $field;
    }
253477
public function telField(IFormModel $model, $property, array $options = [])
    {
        $element = $this->getField($model, $property);
        $options['id'] = $element['id'];

        return Html::telField($element['name'], $element['value'], $options);
    }
84230
public function imageField(IFormModel $model, $property, array $options = [])
    {
        $element = $this->getField($model, $property);
        $options['id'] = $element['id'];
        $image = !empty($options['image']) ? $options['image'] : [];

        return Html::imageField($element['name'], $element['value'], $image, $options);
    }
357166
public static function dateFormat($model, $attribute, $options = [], $pickerOptions = [])
    {
        $pickerOptions = array_merge([
            'language' => Yii::$app->language == 'en' ? 'en-US' : Yii::$app->language,
            'model' => $model,
            'attribute' => $attribute,
            'options' => ['class' => 'form-control'],
        ], $pickerOptions);
        return array_merge([
            'attribute' => $attribute,
            'format' => 'date',
            'filter' => DatePicker::widget($pickerOptions)
        ], $options);
    }
1177370
public function urlField($model, $attribute, $htmlOptions = array())
    {
        return $this->createInput(TbHtml::INPUT_TYPE_URL, $model, $attribute, $htmlOptions);
    }
1305918
public function generateGridViewField($attribute, $fk, $tableSchema = null)
    {
        if (is_null($tableSchema)) {
            $tableSchema = $this->getTableSchema();
        }

        if (in_array($attribute, $this->hiddenColumns)) {
            return "['attribute' => '$attribute', 'visible' => false],\n";
        }
        if ($tableSchema === false || !isset($tableSchema->columns[$attribute])) {
            if (preg_match('/^(password|pass|passwd|passcode)$/i', $attribute)) {
                return "";
            } else {
                return "'$attribute',\n";
            }
        }
        $column = $tableSchema->columns[$attribute];
        $format = $this->generateColumnFormat($column);
        $baseClass = StringHelper::basename($this->modelClass);

        if (array_key_exists($attribute, $fk)) {
            $rel = $fk[$attribute];
            if ($rel[self::REL_CLASS] == $baseClass) {
                return "";
            }
            $labelCol = $this->getNameAttributeFK($rel[3]);
//            $modelRel = $rel[2] ? lcfirst(Inflector::pluralize($rel[1])) : lcfirst($rel[1]);
            $output = "[
                'attribute' => '$rel[7].$labelCol',
                'label' => " . $this->generateString(ucwords(Inflector::humanize($rel[5]))) . "
            ],\n";
            return $output;
        } else {
            return "'$attribute" . ($format === 'text' ? "" : ":" . $format) . "',\n";
        }
    }
904392
public static function numberFieldControlGroup($name, $value = '', $htmlOptions = array())
    {
        return self::controlGroup(self::INPUT_TYPE_NUMBER, $name, $value, $htmlOptions);
    }
498360
public function renderMultiInput ($model, $attribute)
    {
        $inputName = Html::getInputName($model, $attribute);
        Html::addCssClass($this->chooseButtonClass, "btn {$this->_hashVar}");
        $eles = [];
        $eles[] = Html::textInput($attribute, null, ['class' => 'form-control', 'readonly' => 'readonly']);
        $eles[] = Html::hiddenInput($inputName, null);
        $eles[] = Html::tag('span', Html::button('选择图片', $this->chooseButtonClass), ['class' => 'input-group-btn']);

        return Html::tag('div', implode("\n", $eles), ['class' => 'input-group']);
    }
271690
public function searchQuery($model, $attribute, $htmlOptions = array())
    {
        return $this->createInput(TbHtml::INPUT_TYPE_SEARCH, $model, $attribute, $htmlOptions);
    }
419969
public function textFieldRow(IFormModel $model, $property, array $options = [])
    {
        $element = $this->getField($model, $property);
        $options['id'] = $element['id'];

        return Html::openTag('div', $this->getBlock('block', $options)).
        Html::label($model->getLabel($property), $element['id'], $this->getBlock('label', $options)).
        $this->textField($model, $property, $options).
        Html::closeTag('div');
    }
940864
protected function getAttributeId($attribute)
	{
		return isset($this->htmlOptions['id'])
			? $this->htmlOptions['id']
			: CHtml::getIdByName(CHtml::resolveName($this->model, $attribute));
	}
1066517
public function telFieldRow(IFormModel $model, $property, array $options = [])
    {
        $element = $this->getField($model, $property);
        $options['id'] = $element['id'];

        return Html::openTag('div', $this->getBlock('block', $options)).
        Html::label($model->getLabel($property), $element['id'], $this->getBlock('label', $options)).
        $this->telField($model, $property, $options).
        Html::closeTag('div');
    }
464466
public function fileFieldRow($model, $attribute, $htmlOptions = array())
	{
		return $this->inputRow(CiiInput::TYPE_FILE, $model, $attribute, null, $htmlOptions);
	}
646428
protected function _formatNumber($templater, $options)
    {
        $url = array_merge($options['url'], ['page' => $options['page']]);
        $vars = [
            'text' => $options['text'],
            'url' => $this->generateUrl($url, $options['model']),
        ];

        return $templater->format('number', $vars);
    }