Creates a form submit button.

@param string $text
@param string $attributes

@return string
553139
public static function submit($text, $attributes = array())
    {
        if (isset($attributes['name'])) {
            $name = $attributes['name'];
            unset($attributes['name']);
        } else {
            $name = 'submit';
        }

        return self::input('submit', $name, array_merge(array('value' => $text), $attributes));
    }
1038986
public static function input($type, $name, $value = null, array $attributes = array())
    {
        if ($type === 'textarea') {
            $input = '<textarea{{attr}}>';

            if ($value !== null) {
                $input .= self::entities($value);
            }

            $input .= '</textarea>';
        } elseif (preg_match('#^(' . self::$alloweds . ')$#', $type)) {
            $input = '<input type="' . $type . '" value="';

            if ($value !== null) {
                $input .= self::entities($value);
            }

            $input .= '"{{attr}}' . self::$useXhtml . '>';
        } else {
            throw new Exception('Invalid type');
        }

        return self::setAttr($attributes, $input, $name, $type);
    }
822358
protected static function generateTag($tag, $content, $attributes = [])
	{
		$text = '';
		$attribute = self::attribute($attributes);
		if (is_string($tag))
			$text .= "<{$tag}{$attribute}>".PHP_EOL;
		
		if (is_array($content)) {
			if (isset($content['type']) and $content['type'] = 'cdata') {
				$text .="<![CDATA[".PHP_EOL;
				$text .= $content['data'].PHP_EOL;
				$text .="]]>".PHP_EOL;
			} else {
				foreach ($content as $tg => $ct) {
					if (is_array($ct) && isset($ct['content']) && isset($ct['attribute']))
						$text .= self::generateTag($tg, $ct['content'], $ct['attribute']);
					else
						$text .= self::generateTag($tg, $ct);
				}
			}
		} elseif (is_string($content)) {
			$text .= $content;
		}
		
		if (is_string($tag))
			$text .= "</{$tag}>".PHP_EOL;
		return $text;
	}
183917
public static function form( array $attributes = array(), $value = null, $close = false )
    {
        return static::tag( 'form', $attributes, $value, $close );
    }
1025018
public function submit ($text, $options = [])
		{
			$this->label(false);
			$this->parts[ '{input}' ] = Html::submitButton($text, [ 'class' => 'btn btn-lg btn-primary', 'name' => 's-' . $this->attribute ]);

			return $this;
		}
410267
public function button($field, $value = null, array $attributes = array())
	{
		if (is_array($field))
		{
			$attributes = $field;
			$value = isset($attributes['value']) ? $attributes['value'] : $value;
		}
		else
		{
			$attributes['name'] = (string) $field;
			$value = isset($value) ? $value :  $attributes['name'];
		}

		return html_tag('button', $this->attr_to_string($attributes), $value);
	}
5334
public function createParagraph($text = null, array $attributes = [])
    {
        $paragraph = new Paragraph();

        if (count($attributes)) {
            foreach ($attributes as $name => $value) {
                $paragraph->attributes->addAttribute($name, $value);
            }
        }

        if ($text instanceof Element) {
            $paragraph->childNodes->push($text);
        } elseif ( ! is_null($text)) {
            $paragraph->textContent->push($text);
        }

        $this->childNodes->push($paragraph);

        return $this->childNodes->last();
    }
1031332
protected function submitForm($buttonText, $inputs = [], $uploads = [])
    {
        $this->makeRequestUsingForm($this->fillForm($buttonText, $inputs), $uploads);

        return $this;
    }
1134908
public function getHtml(array $attributes = []): string
    {
        return self::buildTag('option', $this->getLabel(),
            array_merge(
                [
                    'value'    => $this->getValue(),
                    'selected' => $this->isSelected,
                ],
                $attributes)
        );
    }
988204
public function open($url, array $attributes = [])
    {
        $tag = new Tag('form', $attributes);
        $tag->action = $url;
        $tag->method = 'POST';
        return $tag;
    }
454562
public function getHtml(array $attributes = []): string
    {
        return self::buildTag('input', null,
            array_merge(
                [
                    'type'     => $this->getType(),
                    'name'     => $this->getName(),
                    'value'    => $this->getText() !== '' ? $this->getText() : false,
                    'required' => $this->isRequired(),
                ],
                $attributes
            )
        );
    }
739165
public function createInput(array $attributes = [])
    {
        $field = new Components\Form\Elements\Input();

        if (count($attributes)) {
            foreach ($attributes as $name => $value) {
                $field->attributes->addAttribute($name, $value);

                if ($name === 'name') {
                    $this->entity->setEntityName('input-' . $value);

                    if ( ! array_key_exists('id', $attributes)) {
                        $field->attributes->setAttributeId('input-' . $value);
                    }
                }
            }
        }

        $this->childNodes->push($field);

        return $this->childNodes->last();
    }
49089
private static function _parse_form_attributes($attributes, $default)
    {
        if (is_array($attributes)) {
            foreach ($default as $key => $val) {
                if (isset($attributes[$key])) {
                    $default[$key] = $attributes[$key];
                    unset($attributes[$key]);
                }
            }

            if (count($attributes) > 0) {
                $default = array_merge($default, $attributes);
            }
        }

        $att = '';

        foreach ($default as $key => $val) {
            if ($key == 'value') {
                $val = self::form_prep($val, $default['name']);
            }

            $att .= $key . '="' . $val . '" ';
        }

        return $att;
    }
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));
    }
269797
public static function textarea($name, $text, array $attributes = array())
    {
        if ($name !== null) {
            $attributes['name'] = $name;
        }

        $node = new Node\Textarea($text);
        return $node->render($attributes);
    }
874228
protected  function form_open( array $attributes = [], $echo = true){
        $attributes = array_merge([
            'method' => $this->method,
            'action' => $this->ajax_url(),
        ], $attributes);
        $str = [];
        foreach( $attributes as $key => $value ){
            $str[] = sprintf('%s="%s"', $key, esc_attr($value));
        }
        $str = implode(' ', $str);
        $html = "<form {$str}>";
        $html .= sprintf('<input type="hidden" name="action" value="%s" />', esc_attr($this->action));
        $html .= $this->nonce_field('_wpnonce', false, false);
        if( $echo ){
            echo $html;
        }
        return $html;
    }
1082071
public static function createElement($tag = '', $attributes1 = [], $attributes2 = [])
    {
        $tag_object = parent::createElement($tag);
        $tag_object->setTag($tag);
        $attributes = $attributes1;
        if (!is_array($attributes1) && strlen($attributes1) > 0) {
            $tag_object->text($attributes1);
            $attributes = $attributes2;
        }
        if (is_array($attributes)) {
            foreach ($attributes as $name => $value) {
                if (method_exists($tag_object, $name)) {
                    if (!is_array($value)) {
                        $value = [$value];
                    }
                    call_user_func_array([$tag_object, $name], $value);
                }
            }
        }

        $tag_object->configDefaults($tag);

        return $tag_object;
    }