CodeIgniter Forums
Loops in views - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Loops in views (/showthread.php?tid=4915)



Loops in views - El Forum - 12-22-2007

[eluser]ccachor[/eluser]
I'm wondering where I would do my if statements to check whether more photos exist to place as thumbnails. I was thinking in the controller but it's I'm starting to think it would make more sense in the view. What have you all done?


Loops in views - El Forum - 12-22-2007

[eluser]tonanbarbarian[/eluser]
I do not have problems putting simple condition or loop statements in the view.
simple data formatting is ok as well.
However I try not to do things like load libraries, model, helpers etc in the view.
I will make calls to helper functions but generally I will load the helper in the controller, after all you should know what helpers will be needed by which views.