Custom Validation Messages not shown |
Hello everyone,
I'm trying to validate a form with a custom error message. The message displayed is always the default, in English. Here is my code: PHP Code: $validation = \Config\Services::validation(); For testing I print the getRules(): PHP Code: Array ( [sonde_nom] => Array ( [label] => Nom [rules] => Array ( [0] => required [1] => min_length[3] ) ) ) What did I miss? Thank you in advance for your help
See https://codeigniter.com/user_guide/incom...s-validate
But as the Important note says, we recommend that you use the validateData() method instead. https://codeigniter.com/user_guide/incom...lidatedata
Try:
PHP Code: $rules = [ (08-02-2024, 04:51 PM)kenjis Wrote: See https://codeigniter.com/user_guide/incom...s-validate I see that was introduces way back in 4.2.0, before I started with CI. I somehow missed that. Now I need to update my projects, most of which are nearing deployment. |
Welcome Guest, Not a member yet? Register Sign In |