Welcome Guest, Not a member yet? Register   Sign In
Validation in controllers
#9

Hi, I was dealing with the same problem where to put validation and my conclusion is that, you can do both validation in controller (checking if format is correct and check against injections) and in model checking for data integrity. That means you can use model from different controllers/libraries and submit data and it will be valid until model it allows, if you decide configure form validation you simple edit controller where is only place that use form validation. Model can be used by many other classes. If you want to keep it as slim as possible use private function like it was suggested. This seams the most logical way.
Reply


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 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



Theme © iAndrew 2016 - Forum software by © MyBB