form/FormPlus.php
/**
     * Parse form varibles.
     * Pass an array of FormField and a data entity object into this method,
     * if success, the entity contains the form data,
     * if fail, the entity contains the form data and error message.
     * If fail and if form hint entity is not empty, the error message will extract into form hint and,
     * If parameter $against_xss is TRUE, form data will be filted by htmlspecialchars() function.
     * @param Array of FormField $form_fields or FormField if only one form field
     * @param Object $form_data
     * @param Object $form_hint
     * @param boolean $against_xss
     * @return FALSE if success, or TRUE if error occurred.
     */
Parse form varibles.
Pass an array of FormField and a data entity object into this method,
if success, the entity contains the form data,
if fail, the entity contains the form data and error message.
If fail and if form hint entity is not empty, the error message will extract into form hint and,
If parameter $against_xss is TRUE, form data will be filted by htmlspecialchars() function.
Parse form varibles . Pass an array of FormField and a data entity object into this method if success the entity contains the form data if fail the entity contains the form data and error message . If fail and if form hint entity is not empty the error message will extract into form hint and If parameter $against_xss is TRUE form data will be filted by htmlspecialchars () function .
public function parseForm($form_fields, $form_data, $form_hint = FALSE, $against_xss = TRUE) {
        $fp = $this->getFormParser();
        try {
            $fp->parse($form_fields, $form_data);
            return FALSE;
        } catch (\Exception $e) {
            if ($form_hint) {
                $fp->setFormErrorHint($form_hint);
                if ($against_xss) {
                    $fp->makeFormDataHtmlSafe($form_fields, $form_data);
                }
            }
            return TRUE;
        }
    }
public function parseForm ( $ form_fields , $ form_data , $ form_hint = FALSE , $ against_xss = TRUE ) { $ fp = $ this -> getFormParser ( ) ; try { $ fp -> parse ( $ form_fields , $ form_data ) ; return FALSE ; } catch ( \ Exception $ e ) { if ( $ form_hint ) { $ fp -> setFormErrorHint ( $ form_hint ) ; if ( $ against_xss ) { $ fp -> makeFormDataHtmlSafe ( $ form_fields , $ form_data ) ; } } return TRUE ; } }
Parse form varibles.
Parse form varibles .