Best way to implement validation rules |
(02-10-2021, 12:01 PM)jasonzig Wrote:(02-10-2021, 07:33 AM)falcon812311 Wrote: Hi, I love CodeIgniter4 because it is easy to understand and fast! This is my website (https://jaironlanda.com) I'm develop using latest version CodeIgniter 4. Unfortunately, the useguide is hard to understand. It is hard to find the right way to use validation, library, custom model, and etc. Sometime I refer from youtube (https://www.youtube.com/channel/UCIbtEs1...bgD_ake7HA) he is good, he show example how use and how its work! So back to my question about validation rule. I wonder when to use Validation in Models, Validation in Controller, and Validation service? (02-10-2021, 01:07 PM)adnzaki Wrote: I used to store validation in controllers. I just create a method containing rules and messages, so it can be used by one or more methods. I usually make a separation between the app and database by its controller and model. Every data should pass validation in controller before they sent to model to be inserted to database. How you make separation between the app and database? you put all validation rules here? PHP Code: Config\Validation.php Thanks!
This is me. JK not me.
|
Messages In This Thread |
Best way to implement validation rules - by falcon812311 - 02-10-2021, 07:33 AM
RE: Best way to implement validation rules - by jasonzig - 02-10-2021, 12:01 PM
RE: Best way to implement validation rules - by falcon812311 - 02-10-2021, 07:31 PM
RE: Best way to implement validation rules - by adnzaki - 02-10-2021, 01:07 PM
RE: Best way to implement validation rules - by paliz - 02-11-2021, 03:03 AM
|