Create a label for an input.

@param string $name
@param array  $attributes

@return string
436586
public function label($name, $attributes = [])
    {
        $attributeString = '';

        if (!isset($attributes['for'])) {
            $attributeString = 'for="'.$name.'"';
        }

        foreach ($attributes as $key => $value) {
            $attributeString .= $key.'="'.$value.'" ';
        }

        return '<label '.$attributeString.'>'.$name.'</label>';
    }
215019
public static function label($label, $id = null, array $attributes = array())
	{
		return static::$instance->label($label, $id, $attributes);
	}
986326
public function select($name, array $options, $selected = null, array $attributes = [])
    {
        $tag = new Tag('select', $attributes);
        $tag->name = $name;
        
        if ($selected === null)
            $selected = $this->getDefaultValue($name);

        foreach ($options as $value => $label)
        {
            $option = new Tag('option');
            $option->value = $value;
            $option->setText($label);

            if ($selected !== null && $value == $selected)
                $option->selected = true;

            $tag->addChild($option);
        }

        return $tag;
    }
103220
public function addField($name, array $attributes)
    {
        //Argument 1 must be a string
        Argument::i()->test(1, 'string');
        
        $this->fields[$name] = $attributes;
        return $this;
    }
1100268
public function error($name, $attributes = []) {
		if (!isset($this->_errors[$name])) return '';

		list($attributes) = $this->_prepare($name, $attributes);

		$attributes['data-error-for'] = $attributes['id'];
		unset($attributes['id']);
		$attributes = $this->_arrayToAttributesString($attributes);

		// show only the first error. The others could be consequential error
		$value = $this->_escape(current($this->_errors[$name]));

		return "<span{$attributes}>{$value}</span>";
	}
241942
public function select($name, $options = null, $attributes = array())
    {
        $attributes['name'] = $name;

        if (!isset($attributes['id'])) {
            $attributes['id'] = str_replace(array('[', ']'), array('_', ''), $name);
        }

        if (is_array($options)) {
            $options = array_merge(array('options' => array(), 'selected' => null), $options);
            $options = $this->options($options['options'], @$options['selected']);
        }

        return $this->tag('select', (string) $options, $attributes);
    }
1091343
public static function number($name, $value, array $attributes = array())
    {
        $node = new Node\Number();

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

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

        return $node->render($attributes);
    }
923067
public static function inputImage(string $name = '', string $src = '', array $attributes = []): string
    {
        $defaultAttributes = ['method-get' => false, 'class' => 'formImage'];
        $userAttributes = \array_merge($defaultAttributes, $attributes);
        $attributes = [];
        $attributes['type'] = 'image';
        $attributes['name'] = $userAttributes['method-get'] === false ? \sprintf('MFVARS[%s]', $name) : $name;
        $attributes['src'] = $src;
        $attributes['id'] = isset($userAttributes['id']) ? $userAttributes['id'] : $name;
        $userAttributes = static::clearAttributes($userAttributes, ['method-get', 'id']);

        return Tags::input(\array_merge($attributes, $userAttributes));
    }
991297
public static function submit($name, $value, array $attributes = null)
    {
        // Set the input type
        $attributes['type'] = 'submit';

        return Form::input($name, $value, $attributes);
    }
3988
public static function input(string $name, string $value = '', array $attributes = null) : string
    {
        // Set the input name
        $attributes['name'] = $name;

        // Set the input id
        $attributes['id'] = (isset($attributes['id'])) ? $attributes['id'] : $name;

        // Set the input value
        $attributes['value'] = $value;

        if ( ! isset($attributes['type'])) {

            // Default type is text
            $attributes['type'] = 'text';
        }

        return '<input'.Html::attributes($attributes).'>';
    }
908150
public static function buildLabel($name, $label = '', $required = false)
        {
            $out = '';

            if (!empty($label)) {
                $class = 'control-label';
                $requiredLabel = '.req';
                $requiredSuffix = '<span class="required"><i class="icon-asterisk"></i></span>';
                $requiredPrefix = '';
                $requiredClass = 'labelrequired';

                if (false !== $required) {
                    $label = $requiredPrefix . $label . $requiredSuffix;
                    $class .= ' ' . $requiredClass;
                }

                $out .= static::label($name, $label, array('class' => $class));
            }

            return $out;
        }
450965
final protected function attribute($name, $label) {
		static $ordering = 1000; /** @var int $ordering */
		df_eav_setup()->addAttribute('customer', $name, [
			'input' => 'text'
			,'label' => "{$this->labelPrefix()} $label"
			,'position' => $ordering++
			,'required' => false
			,'sort_order' => $ordering
			,'system' => false
			,'type' => 'static'
			,'visible' => false
		]);
		/** @var int $attributeId */
		$attributeId = df_first(df_fetch_col('eav_attribute', 'attribute_id', 'attribute_code', $name));
		df_conn()->insert(df_table('customer_form_attribute'), [
			'attribute_id' => $attributeId, 'form_code' => 'adminhtml_customer'
		]);
	}
284210
public function setAttribute(string $name, string $value) : Label
    {
        $this->tag->setAttribute($name, $value);

        return $this;
    }
883052
public function textarea($name, $attributes = []) {
		list($attributes, $value)	= $this->_prepare($name, $attributes);
		$attributes					= $this->_arrayToAttributesString($attributes);
		$value						= $this->_escape($value);
		return "<textarea{$attributes}>{$value}</textarea>";
	}
620555
public function setLabelAttributes($attributes)
    {
        if (! is_array($attributes)) {
            $attributes = [$attributes];
        }

        $this->label_attributes = $attributes;

        return $this;
    }
1028948
public function label($for, $text = null, $attributes = null)
    {
        return '<label for="'.$name.'" '.(($attributes !== null) ? $this->attributes($attributes) : "").' />'.$text.'</label>';
    }
1060366
public static function label($caption, $for = null, array $attributes = array())
    {
        if (!is_null($for)) {
            $attributes['for'] = $for;
        }

        $node = new Node\Label($caption);
        return $node->render($attributes);
    }