number input

@param   string  $name
@param   string  $value
@param   array   $attributes
@return  Tag
359624
public function number($name, $value = null, array $attributes = [])
    {
        $value = $this->getDefaultValue($name, $value);
        return $this->input('number', $name, $value, $attributes);
    }
494639
public function textarea(String $name = NULL, String $value = NULL, Array $_attributes = [])
    {
        $this->setNameAttribute($name);

        $this->setValueAttribute($value);

        if( ! empty($this->settings['attr']['name']) )
        {
            $this->_postback($this->settings['attr']['name'], $value);

            # 5.8.2.8[added]
            $this->getVMethodMessages();

            # 5.4.2[added]
            $this->_validate($this->settings['attr']['name'], $this->settings['attr']['name']);
            
            # 5.4.2[added]|5.4.5|5.4.6[edited]
            $value = $this->_getrow('textarea', $value, $this->settings['attr']);
        }

        $this->commonMethodsForInputElements('textarea');

        $this->getPermAttribute($perm);

        $this->createTextareaElementByValueAndAttributes($value, $_attributes, $return);

        $this->createBootstrapFormInputElementByType('textarea', $return, $_attributes, $return);

        $this->outputElement .= $this->_perm($perm, $return);

        return $this;
    }
73176
public function input($type, $name, $value = '', $attributes = array())
    {
        $id = str_replace(array('[', ']'), array('_', ''), $name);

        return $this->tag('input', null)
                    ->set(array('type' => $type, 'value' => $value, 'name' => $name, 'id' => $id))
                    ->set($attributes);
    }
377774
final public function tag(string $name, array $attributes = [])
    {
        if ('' === $name) {
            throw new InvalidArgumentException('The tag name in "_defaults" must be a non-empty string.');
        }

        foreach ($attributes as $attribute => $value) {
            if (null !== $value && !is_scalar($value)) {
                throw new InvalidArgumentException(sprintf('Tag "%s", attribute "%s" in "_defaults" must be of a scalar-type.', $name, $attribute));
            }
        }

        $this->definition->addTag($name, $attributes);

        return $this;
    }
1226093
public static function textarea(string $name = '', $value = '', array $attributes = []): string
    {
        $defaultAttributes = ['method-get' => false, 'cols' => 20, 'rows' => 40, 'class' => 'form-textarea'];
        $userAttributes = \array_merge($defaultAttributes, $attributes);
        $attributes = [];
        $attributes['name'] = $userAttributes['method-get'] === false ? \sprintf('MFVARS[%s]', $name) : $name;
        $attributes['id'] = isset($userAttributes['id']) ? $userAttributes['id'] : $name;
        $userAttributes = static::clearAttributes($userAttributes, ['method-get', 'id']);

        return Tags::textarea($value, \array_merge($attributes, $userAttributes));
    }
327533
protected function createAttributeValue($name, $value) {
    // If the value is already an AttributeValueBase object,
    // return a new instance of the same class, but with the new name.
    if ($value instanceof AttributeValueBase) {
      $class = get_class($value);
      return new $class($name, $value->value());
    }
    // An array value or 'class' attribute name are forced to always be an
    // AttributeArray value for consistency.
    if ($name == 'class' && !is_array($value)) {
      // Cast the value to string in case it implements MarkupInterface.
      $value = [(string) $value];
    }
    if (is_array($value)) {
      // Cast the value to an array if the value was passed in as a string.
      // @todo Decide to fix all the broken instances of class as a string
      // in core or cast them.
      $value = new AttributeArray($name, $value);
    }
    elseif (is_bool($value)) {
      $value = new AttributeBoolean($name, $value);
    }
    // As a development aid, we allow the value to be a safe string object.
    elseif (SafeMarkup::isSafe($value)) {
      // Attributes are not supposed to display HTML markup, so we just convert
      // the value to plain text.
      $value = PlainTextOutput::renderFromHtml($value);
      $value = new AttributeString($name, $value);
    }
    elseif (!is_object($value)) {
      $value = new AttributeString($name, $value);
    }
    return $value;
  }
638479
public function startValueElement($name, $value, $attributes = array())
    {
        $this->checkStartValueElement($name);

        $this->xmlWriter->startElement($name);

        foreach ($attributes as $attributeName => $attributeValue) {
            $this->xmlWriter->startAttribute($attributeName);
            $this->xmlWriter->text($attributeValue);
            $this->xmlWriter->endAttribute();
        }

        $this->xmlWriter->text($value);
    }
943775
public static function input( array $attributes = array(), $value = null, $wrapper = null )
    {
        $_html = static::tag( 'input', $attributes, $value, true, true );

        if ( null !== $wrapper )
        {
            $_html = static::div( array('class' => $wrapper), $_html );
        }

        return $_html;
    }
25958
public function input(String $type = NULL, String $name = NULL, String $value = NULL, Array $attributes = []) : String
    {
        if( isset($this->settings['attr']['type']) )
        {
            $type = $this->settings['attr']['type'];

            unset($this->settings['attr']['type']);
        }

        $this->settings['attr'] = [];

        return $this->_input($name, $value, $attributes, $type);
    }
307528
public static function password($name, $value, array $attributes = array())
    {
        $node = new Node\Password();

        if (!is_null($name)) {
            $attributes['name'] = $name;
        }

        if (!is_null($value)) {
            $attributes['value'] = $value;
        }

        return $node->render($attributes);
    }
740554
public static function checkbox($name, $value, $attributes = array())
    {
        $attributes['value'] = $value;
        return self::input('checkbox', $name, $attributes);
    }
667803
public function setAttribute(string $name, string $value) : Element
    {
        $this->getTag()->setAttribute($name, $value);

        return $this;
    }
1079678
public function text($name, $value = null, array $attributes = [])
    {
        $value = $this->getDefaultValue($name, $value);
        return $this->input('text', $name, $value, $attributes);
    }
930825
public function hidden($name, $value = null, array $attributes = array())
    {
        return $this->form->input('hidden', $name, $value, $attributes);
    }
381546
public static function email($name, $value, array $attributes = array())
    {
        $node = new Node\Email();

        if (!is_null($name)) {
            $attributes['name'] = $name;
        }

        if (!is_null($value)) {
            $attributes['value'] = $value;
        }

        return $node->render($attributes);
    }
1054255
public function attr($name, $value = NULL) {
    if (($el = $this->getElement()) === NULL) return NULL;

    if ($el->hasAttribute($name)) {
      if (func_num_args() == 2) {
        $el->setAttribute($name, $value);
      }

      return $el->getAttribute($name);
    }

    return NULL;
  }
19002
public static function attr($name, $value = null)
    {
        if (is_string($name)) {
            $name = [$name => $value];
        }

        return HtmlBuilder::buildAttributes($name);
    }