Gregwar\Formidable\Form::handle PHP Method

handle() public method

Check a form, helper function
public handle ( $callback = null, $errorsCallback = null )
    public function handle($callback = null, $errorsCallback = null)
    {
        if ($this->posted()) {
            $errors = $this->check();
            if (!$errors) {
                if (null !== $callback) {
                    $callback($this->getData());
                }
            } else {
                if (null !== $errorsCallback) {
                    $errorsCallback($errors);
                }
                return $errors;
            }
        }
        return array();
    }