Skip to content

The Validate Method #11

@clevonnoel

Description

@clevonnoel

It would be nice to handle validation like $this->registrationForm->validate();where necessary.

Here are the untested suggested code.

    public function validate(array $formData = null)
    {
        $this->validation = $this->validator->make(
            $formData ?: Input::all(),
            $this->getValidationRules(),
            $this->getValidationMessages()
        );

        if ($this->validation->fails())
        {
            throw new FormValidationException('Validation failed', $this->getValidationErrors());
        }

        return true;
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions