Zepi/Web/UserInterface/src/Layout/LayoutAbstract.php
public function validateFormData(WebRequest $request, Response $response, callable $callback = null)
    {
        $form = $this->searchSubmittedForm($request, $response);
        
        if ($form === null) {
            return Form::NOT_SUBMITTED;
        }
        
        // Validate the data
        $errors = $form->validateFormData($this->framework);
        
        // Execute the custom validation method
        if (is_callable($callback)) {
            $callbackErrors = call_user_func_array($callback, array($this->getFormValues()));
            
            if (is_array($callbackErrors)) {
                $errors = array_merge($errors, $callbackErrors);
            }
        }
        
        if (is_array($errors) && count($errors) > 0) {
            $this->updateErrorBox($form, $errors);
            return Form::DATA_INVALID;
        }
        
        return Form::DATA_VALID;
    }
public function validateFormData(WebRequest $request, Response $response, callable $callback = null)
    {
        $form = $this->searchSubmittedForm($request, $response);
        
        if ($form === null) {
            return Form::NOT_SUBMITTED;
        }
        
        // Validate the data
        $errors = $form->validateFormData($this->framework);
        
        // Execute the custom validation method
        if (is_callable($callback)) {
            $callbackErrors = call_user_func_array($callback, array($this->getFormValues()));
            
            if (is_array($callbackErrors)) {
                $errors = array_merge($errors, $callbackErrors);
            }
        }
        
        if (is_array($errors) && count($errors) > 0) {
            $this->updateErrorBox($form, $errors);
            return Form::DATA_INVALID;
        }
        
        return Form::DATA_VALID;
    }
public function validateFormData ( WebRequest $ request , Response $ response , callable $ callback = null ) { $ form = $ this -> searchSubmittedForm ( $ request , $ response ) ; if ( $ form === null ) { return Form :: NOT_SUBMITTED ; } // Validate the data $ errors = $ form -> validateFormData ( $ this -> framework ) ; // Execute the custom validation method if ( is_callable ( $ callback ) ) { $ callbackErrors = call_user_func_array ( $ callback , array ( $ this -> getFormValues ( ) ) ) ; if ( is_array ( $ callbackErrors ) ) { $ errors = array_merge ( $ errors , $ callbackErrors ) ; } } if ( is_array ( $ errors ) && count ( $ errors ) > 0 ) { $ this -> updateErrorBox ( $ form , $ errors ) ; return Form :: DATA_INVALID ; } return Form :: DATA_VALID ; }
Searches the submitted Form object in the layout and validates the data

@param \Zepi\Turbo\Request\WebRequest $request
@param \Zepi\Turbo\Response\Response $response
@param callable $callback
@return string
Searches the submitted Form object in the layout and validates the data