public function isValid(Request $request)
    {
        $arguments = $this->method === "GET" ? $request->get : $request->post;
        $files = $request->files;

        if (!$this->validate($arguments, $files))
            return false;

        $params = ['form' => $this, 'request' => $request, 'valid' => true, 'arguments' => $arguments];
        $params = TypedDictionary::wrap($params);
        $params->setType('errors', Type::ARRAY);
        $result = Hook::execute('Wedeto.HTTP.Forms.Form.isValid', $params);

        if (!$result['valid'])
        {
            foreach ($result['errors'] as $field => $errors)
            {
                if ($errors instanceof Dictionary)
                    $this->errors[$field] = $errors->toArray();
            }
            return false;
        }

        unset($this->form_elements[Nonce::getParameterName()]);
        unset($this->form_elements['_form_name']);

        return true;
    }
public function isValid(Request $request)
    {
        $arguments = $this->method === "GET" ? $request->get : $request->post;
        $files = $request->files;

        if (!$this->validate($arguments, $files))
            return false;

        $params = ['form' => $this, 'request' => $request, 'valid' => true, 'arguments' => $arguments];
        $params = TypedDictionary::wrap($params);
        $params->setType('errors', Type::ARRAY);
        $result = Hook::execute('Wedeto.HTTP.Forms.Form.isValid', $params);

        if (!$result['valid'])
        {
            foreach ($result['errors'] as $field => $errors)
            {
                if ($errors instanceof Dictionary)
                    $this->errors[$field] = $errors->toArray();
            }
            return false;
        }

        unset($this->form_elements[Nonce::getParameterName()]);
        unset($this->form_elements['_form_name']);

        return true;
    }
public function isValid ( Request $ request ) { $ arguments = $ this -> method === "GET" ? $ request -> get : $ request -> post ; $ files = $ request -> files ; if ( ! $ this -> validate ( $ arguments , $ files ) ) return false ; $ params = [ 'form' => $ this , 'request' => $ request , 'valid' => true , 'arguments' => $ arguments ] ; $ params = TypedDictionary :: wrap ( $ params ) ; $ params -> setType ( 'errors' , Type :: ARRAY ) ; $ result = Hook :: execute ( 'Wedeto.HTTP.Forms.Form.isValid' , $ params ) ; if ( ! $ result [ 'valid' ] ) { foreach ( $ result [ 'errors' ] as $ field => $ errors ) { if ( $ errors instanceof Dictionary ) $ this -> errors [ $ field ] = $ errors -> toArray ( ) ; } return false ; } unset ( $ this -> form_elements [ Nonce :: getParameterName ( ) ] ) ; unset ( $ this -> form_elements [ '_form_name' ] ) ; return true ; }
Check if the form submission is valid
@param Request $request The request containing the submitted data
@return bool True when the submission is valid, false otherwise
Check if the form submission is valid