public function build($id = '', $action = '', $async = true, $fileUpload = false)
    {
        // Set the formID
        $this->formId = ($id ?: 'f' . mt_rand());

        // Build the form
        parent::build($id, $action, $async, $fileUpload);

        // Add extra class
        $this->addClass('form-template');

        // Create form report element
        $this->formReport = $this->getHTMLDocument()->getHTMLFactory()->buildHtmlElement('div', '', '', self::FORM_REPORT_CLASS);
        $this->append($this->formReport);

        // Create form body element
        $this->formBody = $this->getHTMLDocument()->getHTMLFactory()->buildHtmlElement('div', '', '', 'form-body');
        $this->append($this->formBody);

        return $this;
    }
public function build($id = '', $action = '', $async = true, $fileUpload = false)
    {
        // Set the formID
        $this->formId = ($id ?: 'f' . mt_rand());

        // Build the form
        parent::build($id, $action, $async, $fileUpload);

        // Add extra class
        $this->addClass('form-template');

        // Create form report element
        $this->formReport = $this->getHTMLDocument()->getHTMLFactory()->buildHtmlElement('div', '', '', self::FORM_REPORT_CLASS);
        $this->append($this->formReport);

        // Create form body element
        $this->formBody = $this->getHTMLDocument()->getHTMLFactory()->buildHtmlElement('div', '', '', 'form-body');
        $this->append($this->formBody);

        return $this;
    }
public function build ( $ id = '' , $ action = '' , $ async = true , $ fileUpload = false ) { // Set the formID $ this -> formId = ( $ id ? : 'f' . mt_rand ( ) ) ; // Build the form parent :: build ( $ id , $ action , $ async , $ fileUpload ) ; // Add extra class $ this -> addClass ( 'form-template' ) ; // Create form report element $ this -> formReport = $ this -> getHTMLDocument ( ) -> getHTMLFactory ( ) -> buildHtmlElement ( 'div' , '' , '' , self :: FORM_REPORT_CLASS ) ; $ this -> append ( $ this -> formReport ) ; // Create form body element $ this -> formBody = $ this -> getHTMLDocument ( ) -> getHTMLFactory ( ) -> buildHtmlElement ( 'div' , '' , '' , 'form-body' ) ; $ this -> append ( $ this -> formBody ) ; return $ this ; }
Build the form element.

@param string $id         The form id.
@param string $action     The form action url string.
@param bool   $async      Sets the async attribute for simple forms.
@param bool   $fileUpload This marks the form ready for file upload. It adds the enctype attribute where no
characters are encoded. This value is required when you are using forms that have a
file upload control.

@return $this
@throws Exception
@throws InvalidArgumentException
Build the form element .