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
merged 2 commits into from
Jan 6, 2021

Conversation

janbarasek
Copy link
Contributor

@janbarasek janbarasek commented Jan 6, 2021

  • new feature
  • BC break? no

In case of:

$form->addText('stars', 'Stars')
	->setRequired('Please select stars.')
	->addRule(Form::NUMERIC)
	->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.

@dg
Copy link
Member

dg commented Jan 6, 2021

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

@janbarasek
Copy link
Contributor Author

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

@dg
Copy link
Member

dg commented Jan 6, 2021

Thanks

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

Successfully merging this pull request may close these issues.

2 participants