[SOLVED] call MODEL functions in the VIEW, really bad idea? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: [SOLVED] call MODEL functions in the VIEW, really bad idea? (/showthread.php?tid=21502) Pages:
1
2
|
[SOLVED] call MODEL functions in the VIEW, really bad idea? - El Forum - 08-13-2009 [eluser]basementDUDE[/eluser] [quote author="Maglok" date="1250164447"]I'd probably go with making a big query and putting it in my model. You could still move all the small bits to the controller though. If you simply get a set: Code: $data['personen'] = $this->model_persoon->get_all(); Or you need to process it first before sending it to the view like this: Code: foreach($query->result() as $row) { Regardless, you can access them in the view when gotten from the model in the Controller.[/quote] yeah, why I didn't think about that. thank you [SOLVED] call MODEL functions in the VIEW, really bad idea? - El Forum - 08-13-2009 [eluser]basementDUDE[/eluser] [quote author="waldmeister" date="1250166908"]Why not do it all in the model? Code: //in your controller looks very promising. I am gonna try it now. [SOLVED] call MODEL functions in the VIEW, really bad idea? - El Forum - 08-14-2009 [eluser]basementDUDE[/eluser] I have re-coded my view and model as waldmeister suggested, it works great. thanks guys for helping me |