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

Missing validator message should contain validator name. #263

merged 2 commits into from Jan 6, 2021


Copy link

@janbarasek janbarasek commented Jan 6, 2021

  • new feature
  • BC break? no

In case of:

$form->addText('stars', 'Stars')
	->setRequired('Please select stars.')
	->addRule(Form::MIN, null, 0)
	->addRule(Form::MAX, null, 5);

It is not clear from the original message in which validation rule the validation message is missing. The form can be built dynamically from multiple places. This feature adds the name of the validation rule that requires the message.

Thank you.

Copy link

dg commented Jan 6, 2021

$rule->validator can be also callable array or Closure.

Copy link
Contributor Author

@dg FIxed, validator will be inserted only in case of string.

Copy link

dg commented Jan 6, 2021


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

Successfully merging this pull request may close these issues.

None yet

2 participants