public function buildInput($type = 'text', $name = '', $value = '', $id = '', $class = '', $autofocus = false, $required = false, $attributes = [])
    {
        // Create form input
        $id = $id ?: 'fi' . mt_rand();
        $element = new FormInput($this->getHTMLDocument(), $type, $name, $id, $class, $value, $required, $attributes);

        // Add extra attributes
        $element->attr('autofocus', $autofocus);

        // Return form element
        return $element;
    }
public function buildInput($type = 'text', $name = '', $value = '', $id = '', $class = '', $autofocus = false, $required = false, $attributes = [])
    {
        // Create form input
        $id = $id ?: 'fi' . mt_rand();
        $element = new FormInput($this->getHTMLDocument(), $type, $name, $id, $class, $value, $required, $attributes);

        // Add extra attributes
        $element->attr('autofocus', $autofocus);

        // Return form element
        return $element;
    }
public function buildInput ( $ type = 'text' , $ name = '' , $ value = '' , $ id = '' , $ class = '' , $ autofocus = false , $ required = false , $ attributes = [ ] ) { // Create form input $ id = $ id ? : 'fi' . mt_rand ( ) ; $ element = new FormInput ( $ this -> getHTMLDocument ( ) , $ type , $ name , $ id , $ class , $ value , $ required , $ attributes ) ; // Add extra attributes $ element -> attr ( 'autofocus' , $ autofocus ) ; // Return form element return $ element ; }
Builds and returns an input item.

@param string $type       The input's type. This must abide by the rules of the possible input types.
@param string $name       The input's name.
@param string $value      The input's default value.
@param string $id         The input's id attribute.
@param string $class      The extra class for the input.
@param bool   $autofocus  Inserts the autofocus attribute to the input.
@param bool   $required   Indicates this input as required.
@param array  $attributes A set of extra attributes

@return FormElement
@throws Exception
Builds and returns an input item .