Welcome Guest, Not a member yet? Register   Sign In
Advice on doing this better, faster and neater (form and image upload)
#2

[eluser]Crimp[/eluser]
The first thing I would do it to move all db logic to a model. That would clean up your controllers a lot. The second thing I tend to do to keep the actual controller methods easy to read is to move lengthy validation sets to a private function. In your case, that would drop _news_validation() to the bottom. I would also move the file upload to its own function. With all that done, you could easily glance at add_news() and figure it out in an instant.


Messages In This Thread
Advice on doing this better, faster and neater (form and image upload) - by El Forum - 05-14-2008, 02:06 AM



Theme © iAndrew 2016 - Forum software by © MyBB