Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form Validation #1290

Closed
agus-prawoto opened this issue Oct 3, 2018 · 1 comment
Closed

Form Validation #1290

agus-prawoto opened this issue Oct 3, 2018 · 1 comment

Comments

@agus-prawoto
Copy link

agus-prawoto commented Oct 3, 2018

I just simply run a simple form validation:

$validation->setRule('first_name', 'First Name', 'required');
$validation->run();
print_r($validation->getErrors());

Output:
Array
(
[first_name] => The First Name field is required.
)

print_r($_POST);
Output:
Array
(
[first_name] => Agus
)

@lonnieezell
Copy link
Member

There's no bug here. You didn't give validation any data to validate against.

You might try $validation->withRequest()->run(), or use the controller's helper method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants