![]() |
How to pass variable from model to controller and define in the view? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: How to pass variable from model to controller and define in the view? (/showthread.php?tid=42039) |
How to pass variable from model to controller and define in the view? - El Forum - 05-24-2011 [eluser]Juan Velandia[/eluser] Hello Every one I've dealing with this for a while, I hope you can put me on the right track, I need to show some data from DB on different menus according with the "placeholder" field in the "cms_section" table, here is the code so far: model: Code: function show_item_placeholder($placeholder) Controller: Code: function index($placeholder) and the view: "top_menu.php" Code: $placeholder = '1'; Any ideas would be highly appreciated, thanks! How to pass variable from model to controller and define in the view? - El Forum - 05-24-2011 [eluser]Juan Velandia[/eluser] well I`ve decided to go like this: controller: Code: function placeholder($placeholder){ view: Code: <?echo anchor('home/', 'Inicio', array('class'=>'menuh1')) ?> |