Own validation rules with CodeIgniter >4.5 |
Thank you very much for your feedback. To be honest, I'm still a bit in the fog, although I have looked at the code and the documentation again.
Quote:You've modified your $rulesets array to use Traditional Rules, which the documentation say is a no-no. My $ruleSets array: PHP Code: public array $ruleSets = [ But the documentary says: https://codeigniter.com/user_guide/libra...rict-rules Quote:Since v4.3.0, Strict Rules are used by default for better security. And you can also see above: PHP Code: use CodeIgniter\Validation\StrictRules\CreditCardRules; Maybe I haven't really understood what $ruleSets is used for in the system. My understanding was: If I don't register the class there, the system can't do anything with rules like hasValidMxRecord. In the example code, however, I don't see it registered in $ruleSets and it's called PHP Code: if ($this->validateData($input, ExpenseRules::create()) === false) { instead of PHP Code: $validation = service('validation'); But from the documentation I primarily see the path via $validation->setRules(). Where am I missing the connection or understanding? What exactly in my code is causing me to not follow the strict recommendation in the documentation? |
Messages In This Thread |
Own validation rules with CodeIgniter >4.5 - by minsk832 - 02-05-2025, 09:08 AM
RE: Own validation rules with CodeIgniter >4.5 - by ozornick - 02-05-2025, 12:35 PM
RE: Own validation rules with CodeIgniter >4.5 - by minsk832 - 02-05-2025, 02:27 PM
RE: Own validation rules with CodeIgniter >4.5 - by grimpirate - 02-05-2025, 07:13 PM
RE: Own validation rules with CodeIgniter >4.5 - by ozornick - 02-05-2025, 10:36 PM
RE: Own validation rules with CodeIgniter >4.5 - by minsk832 - 02-07-2025, 04:49 PM
RE: Own validation rules with CodeIgniter >4.5 - by grimpirate - 02-07-2025, 06:31 PM
RE: Own validation rules with CodeIgniter >4.5 - by ozornick - 02-08-2025, 12:33 AM
RE: Own validation rules with CodeIgniter >4.5 - by grimpirate - 02-08-2025, 11:26 AM
RE: Own validation rules with CodeIgniter >4.5 - by ozornick - 02-08-2025, 01:38 PM
RE: Own validation rules with CodeIgniter >4.5 - by grimpirate - 02-08-2025, 02:28 PM
|