Welcome Guest, Not a member yet? Register   Sign In
Custom Validation Rule in Model
#1

I know we can have custom validation rules in the controller, by adding more rule sets to the /Config/Validation.php file but how do we add them to the model when performing validation there.
Something like:

PHP Code:
protected $validationRules = ['myfield'  => 'trim|required|customRule(myfield')]; 
Is it possible to call in the Model like this and how do you include any custom validation libraries in the model, if possible?
Thanks for any help and suggestions.
Reply


Messages In This Thread
Custom Validation Rule in Model - by josh2112o - 01-22-2021, 03:28 AM
RE: Custom Validation Rule in Model - by iRedds - 01-22-2021, 02:23 PM
RE: Custom Validation Rule in Model - by iRedds - 01-22-2021, 05:26 PM
RE: Custom Validation Rule in Model - by iRedds - 01-22-2021, 09:24 PM



Theme © iAndrew 2016 - Forum software by © MyBB