Welcome Guest, Not a member yet? Register   Sign In
Where to put build table rows HTML?
#4

(06-25-2018, 04:41 AM)hacksler Wrote: ...

Now i wonder where to read from database and transform the results into HTML-Tags. Should it be done in controller or in view?
Should i code it inside the view? I guess this would break the concept of separating business-logic and content... ir should it do it inside the controller?

You should not write much code in your view. It should just contain html and print statements and loops and if statements that directly outputs the presentation. 

In your controller you create whatever models you need and pass the data into the view where its rendered.
Simpler is always better
Reply


Messages In This Thread
Where to put build table rows HTML? - by hacksler - 06-25-2018, 04:41 AM
RE: Where to put build table rows HTML? - by donpwinston - 06-26-2018, 07:25 AM



Theme © iAndrew 2016 - Forum software by © MyBB