|
Hello, So I am using Mojolicious::Validator for the first time. After reading the tutorial, I see that one can simply have the invalid field become "field-with-error" and the end user may see the description of the invalid field e.g. in red. That's neat but what if I want to tell the end user exactly which check did not pass? Is there a very convenient way of doing that? And in a multi-lingual context... I also thought of running all the validation and then looking in the return value of $v->error() if $v->has_error(); |
Replies: 1 comment 4 replies
|
I tend to use something similar to this in the templates. I don't feel the full error message on validation belongs in the controller. That is more a template thing. The validation system only spits out these markers (the name of the validation the failed). It is your job to write a suitable error message for it. Using suitable helpers one can simplify to making the syntax much simpler. |
I tend to use something similar to this in the templates. I don't feel the full error message on validation belongs in the controller. That is more a template thing.
The validation system only spits out these markers (the name of the validation the failed). It is your job to write a suitable error message for it.
Using suitable helpers one can simplify to
making the syntax much simpler.