public function validate(Dictionary $arguments, Dictionary $files)
    {
        // Check all submitted values
        $complete = true;
        $this->errors = [];
        $this->value = [];
        foreach ($this->form_elements as $name => $element)
        {
            if ($element instanceof Form)
            {
                // Subforms are validated as sub form to unwrap nested structures
                if (!$element->validateAsSubForm($arguments, $files))
                {
                    $this->errors[$name] = $element->getErrors();
                    $complete = false;
                }
            }
            elseif (!$element->validate($arguments, $files))
            {
                // Delegate validation to the form field
                $this->errors[$name] = $element->getErrors();
                $complete = false;
            }
            $this->value[$name] = $element->getValue();
        }

        foreach ($this->form_validators as $validator)
        {
            if (!$validator->validate($this))
            {
                $complete = false;
                $error = $validator->getErrorMessage($this);
                $this->errors[''][] = $error;
            }
        }

        return $complete;
    }
public function validate(Dictionary $arguments, Dictionary $files)
    {
        // Check all submitted values
        $complete = true;
        $this->errors = [];
        $this->value = [];
        foreach ($this->form_elements as $name => $element)
        {
            if ($element instanceof Form)
            {
                // Subforms are validated as sub form to unwrap nested structures
                if (!$element->validateAsSubForm($arguments, $files))
                {
                    $this->errors[$name] = $element->getErrors();
                    $complete = false;
                }
            }
            elseif (!$element->validate($arguments, $files))
            {
                // Delegate validation to the form field
                $this->errors[$name] = $element->getErrors();
                $complete = false;
            }
            $this->value[$name] = $element->getValue();
        }

        foreach ($this->form_validators as $validator)
        {
            if (!$validator->validate($this))
            {
                $complete = false;
                $error = $validator->getErrorMessage($this);
                $this->errors[''][] = $error;
            }
        }

        return $complete;
    }
public function validate ( Dictionary $ arguments , Dictionary $ files ) { // Check all submitted values $ complete = true ; $ this -> errors = [ ] ; $ this -> value = [ ] ; foreach ( $ this -> form_elements as $ name => $ element ) { if ( $ element instanceof Form ) { // Subforms are validated as sub form to unwrap nested structures if ( ! $ element -> validateAsSubForm ( $ arguments , $ files ) ) { $ this -> errors [ $ name ] = $ element -> getErrors ( ) ; $ complete = false ; } } elseif ( ! $ element -> validate ( $ arguments , $ files ) ) { // Delegate validation to the form field $ this -> errors [ $ name ] = $ element -> getErrors ( ) ; $ complete = false ; } $ this -> value [ $ name ] = $ element -> getValue ( ) ; } foreach ( $ this -> form_validators as $ validator ) { if ( ! $ validator -> validate ( $ this ) ) { $ complete = false ; $ error = $ validator -> getErrorMessage ( $ this ) ; $ this -> errors [ '' ] [ ] = $ error ; } } return $ complete ; }
Make sure the form was submitted correctly. When errors occur,
these can be obtained using getErrors.

@param Dictionary $arguments The submitted arguments
@param Dictionary $files The submitted files
@return bool True if all fields validate, false if not.
Make sure the form was submitted correctly . When errors occur these can be obtained using getErrors .