Welcome Guest, Not a member yet? Register   Sign In
Refreshing re-enters the data in the db again and again. Help?
#5

[eluser]Otemu[/eluser]
The correct way is actually to redirect through the controller which is fine and true to mvc, so what you have done is correct.

Just in case you wondering why I then mentioned model redirection, well this was more due to the book Professional Codeigniter that I started with when learning Codeigniter. I guess the concept behind this was to minimise code.

I assume the author of the book made the assumption when it came to user registration that once all validation had been complete and the form data had been successfully inserted through the model that a redirection was definitely always going to take place, so why have extra code for the controller to check the returned value of the model when you know that your going to redirect anyway. I wouldn't say this is best practice however.


Messages In This Thread
Refreshing re-enters the data in the db again and again. Help? - by El Forum - 05-30-2012, 02:46 AM



Theme © iAndrew 2016 - Forum software by © MyBB