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

(This post was last modified: 09-05-2019, 11:41 AM by milengardev1994.)

Hello all,

I have some general best practices question about how to handle validation. 
As far as my knowledge gets we do form validation in the controller. For example, to check if certain fields are required, max length and etc.
In my practise I have seen that sometimes this validation checks can become quite big.
In those cases I usually separate them the in different private function in the controller so the code can be more readable and to off-load some of the function content.
However I don't feel that having private functions in the controller and chunking the things so much is a good thing and also in terms of reusability can be not so handy to keep them in the controller.

What would you suggest when you have large validation functions?
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