Common\Core\Form::addText PHP Method

addText() public method

Adds a single textfield.
public addText ( string $name, string $value = null, integer $maxLength = 255, string $class = null, string $classError = null, boolean $HTML = true ) : SpoonFormText
$name string The name of the element.
$value string The value inside the element.
$maxLength integer The maximum length for the value.
$class string Class(es) that will be applied on the element.
$classError string Class(es) that will be applied on the element when an error occurs.
$HTML boolean Will this element contain HTML?
return SpoonFormText
    public function addText($name, $value = null, $maxLength = 255, $class = null, $classError = null, $HTML = true)
    {
        $name = (string) $name;
        $value = $value !== null ? (string) $value : null;
        $maxLength = $maxLength !== null ? (int) $maxLength : null;
        $class = $class !== null ? (string) $class : 'form-control fork-form-text';
        $classError = $classError !== null ? (string) $classError : 'error';
        $HTML = (bool) $HTML;
        // create and return a textfield
        return parent::addText($name, $value, $maxLength, $class, $classError, $HTML);
    }