• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Correct understanding of MVC system?

#5
[eluser]David Cassidy[/eluser]
[quote author="JanDoToDo" date="1262453882"]Thanks for your repsonses. Smile So, in my case above, I am using the get_boats to run a query and then return the result set from that query and then running the draw_results to create the markup for the pagination links and the content on the page. Would you suggest taking the draw_results function out of the model and then putting it in the controller then? In which case, all the model would do is run the query and then return the resultset back to the controller?

I put the draw_results function in the model as I want different controllers to haave access to it. How would I do it otherwise..? Oh.. I just thought.. I guess i'd use a library as well??

Many thanks! Smile Oh and Dave_c -> I'll make the correction! Smile[/quote]

Relocating _draw_results() to your controller is precisely the way you should do it. If you want to make it accessible to other controllers, a library (or perhaps a simple helper - since a library would be a bit of overkill) would do the trick.


Messages In This Thread
Correct understanding of MVC system? - by El Forum - 01-01-2010, 06:46 PM
Correct understanding of MVC system? - by El Forum - 01-01-2010, 11:42 PM
Correct understanding of MVC system? - by El Forum - 01-02-2010, 03:55 AM
Correct understanding of MVC system? - by El Forum - 01-02-2010, 05:38 AM
Correct understanding of MVC system? - by El Forum - 01-02-2010, 05:41 AM
Correct understanding of MVC system? - by El Forum - 01-02-2010, 05:48 AM
Correct understanding of MVC system? - by El Forum - 01-02-2010, 05:52 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.