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;
    }