![]() |
Clean up my view - 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: Clean up my view (/showthread.php?tid=2722) |
Clean up my view - El Forum - 08-21-2007 [eluser]johnwbaxter[/eluser] I would really like to get this sort of stuff out of my view Code: <?php foreach($con_options->result() as $item):?> and into a controller. I'm not averse to using the CI template syntax but i really cant figure out how to do it. Any ideas? Clean up my view - El Forum - 08-21-2007 [eluser]Michael Wales[/eluser] You kind of want that sort of stuff in your view. I mean, you could add this into your controller, but it's going to suck trying to manage: Code: <?php foreach ($con_options->result() as $item) { Then in your view: Code: <?= $sucky_large_block_to_echo; ?> That's really abusing the system though and you may as well move to one large file, dropping the MVC framework altogether. Clean up my view - El Forum - 08-21-2007 [eluser]johnwbaxter[/eluser] I thought that might be the case. As long as i'm not doing it the stupid way then i don't mind! Having a look through Oscar Bajner's sample files at his Obsession lib has given me some excellent pointers for getting some more stuff out of the view and into the controller though. I recommend having a peruse! |