Skip to content

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