Welcome Guest, Not a member yet? Register   Sign In
Own validation rules with CodeIgniter >4.5
#8

I do not recommend using groups $newsletter in Validation.  Just think that you have >100 rules, you will get lost in them. I discovered this before I had done half of the project. 

Use separate arrays - I've taken out their classes. 
$ruleSets don't need to be updated, look inside Expense::create() - there are a set of rules inside, not a custom check. You also need to add a handler NewsletterRules to $ruleSets, and put the rule set anywhere else. 

You saved them in public static $rules, that's fine. You just need to work with the name for different cases: $create $update...
Simple CI 4 project for beginners codeigniter-expenses ( topic )
Reply


Messages In This Thread
RE: Own validation rules with CodeIgniter >4.5 - by ozornick - 02-08-2025, 12:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB