Hello, I’m new to Trongate and I’m really excited about the framework. I’d like to know how to validate data received via POST in Models.
Thanks in advance, and congratulations to the creator of this wonderful, one-of-a-kind framework. It was much needed – thank goodness someone’s done it!
Validate the data entered into the model.
29 days ago
29 days ago
#1
29 days ago
#2
Hello asardon and Welcome to Trongate! 🙂
Data validation (like everything else) is very straightforward in Trongate.
This is how it works: set rule(s) -> run validation -> handle result
Here is an example with validating a name:
This should be all handled in your Controller file (e.g. Users.php).
For more details, please visit:
https://trongate.io/documentation/trongate_php_framework/form-validation/form-validation-introduction
If you have any questions or need further explanation, please let me know.
Happy coding!
Data validation (like everything else) is very straightforward in Trongate.
This is how it works: set rule(s) -> run validation -> handle result
Here is an example with validating a name:
This should be all handled in your Controller file (e.g. Users.php).
For more details, please visit:
https://trongate.io/documentation/trongate_php_framework/form-validation/form-validation-introduction
If you have any questions or need further explanation, please let me know.
Happy coding!
28 days ago
#3
Yes, that's the method documented on the Trongate website. I was referring to doing it in the model, in your example, Users_model.php. I ran the validation module code through the AI, and it provided a solution that was exactly what I was looking for.
Regards
Regards
28 days ago
#4
I'm glad you found the solution you were looking for. 👍🏻