Validation in controllers |
You can also just grab all the data in the controller, pass them to the model and do the validation in the model. Throw an exception if it's not valid and make your controller catch the exception to display the error in the view. That way you can call the validation function from anywhere in the application.
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/ |
Messages In This Thread |
Validation in controllers - by milengardev1994 - 09-05-2019, 09:15 AM
RE: Validation in controllers - by includebeer - 09-05-2019, 11:34 AM
RE: Validation in controllers - by php_rocs - 09-05-2019, 02:11 PM
RE: Validation in controllers - by milengardev1994 - 09-14-2019, 11:59 PM
RE: Validation in controllers - by John_Betong - 09-15-2019, 12:59 AM
RE: Validation in controllers - by jreklund - 09-15-2019, 01:25 AM
RE: Validation in controllers - by includebeer - 09-15-2019, 05:47 AM
RE: Validation in controllers - by website - 09-15-2019, 10:44 AM
RE: Validation in controllers - by JoellSVK - 01-14-2020, 01:36 AM
RE: Validation in controllers - by TonyBurgos - 02-15-2020, 01:27 PM
RE: Validation in controllers - by angrymongol - 02-25-2020, 09:45 AM
|