Welcome Guest, Not a member yet? Register   Sign In
Separating Code / Error Handling
#2

[eluser]wh1tel1te[/eluser]
Sure, there is no reason why you can't handle the form validation in another method. In your index() method, just call the add_contact() method, which will return your errors. If you don't want people to be able to access "index.php/contacts/add_contact", you can add an underscore before the "add_contact" method to make it private, so it becomes "_add_contact()".


Messages In This Thread
Separating Code / Error Handling - by El Forum - 04-05-2011, 03:00 AM
Separating Code / Error Handling - by El Forum - 04-05-2011, 03:15 AM
Separating Code / Error Handling - by El Forum - 04-05-2011, 03:22 AM
Separating Code / Error Handling - by El Forum - 04-05-2011, 07:58 AM



Theme © iAndrew 2016 - Forum software by © MyBB