Welcome Guest, Not a member yet? Register   Sign In
new to MVC
#1

[eluser]jochemvn[/eluser]
Hello,

I'm new to the MVC concept and I have a question. I have a controller a model and a view. Now in this controller I load my model and load some data into a variable. However it's possible that my model doesn't return any rows.

Where should I check this? I think I have 2 options:

1) The controller
Check if the variable I pass the data to is empty or not and load a different view for when it's empty.

2) The view
Check if the variable that it's given is empty and create two different sections of HTML in the view (one for when the var is empty and one for when there's data to show)

Which is the best, or is there an other option?


Messages In This Thread
new to MVC - by El Forum - 07-01-2010, 11:56 PM
new to MVC - by El Forum - 07-02-2010, 01:21 AM
new to MVC - by El Forum - 07-02-2010, 01:34 AM
new to MVC - by El Forum - 07-02-2010, 02:12 AM
new to MVC - by El Forum - 07-02-2010, 03:05 AM
new to MVC - by El Forum - 07-02-2010, 10:08 PM



Theme © iAndrew 2016 - Forum software by © MyBB