![]() |
Template Parser - 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: Template Parser (/showthread.php?tid=41394) |
Template Parser - El Forum - 05-06-2011 [eluser]ann91[/eluser] hello guys, i have problem about this code. i use codeigniter 2.0.2. In this case, i want to make template with class Template Parser. Code: function index() Code: function getRecentPost() if i want to add <b>Postmodel</b> into <b>content</b> pseudo-variables, how i write it?? in codeigniter 1.7.2, the code like this.. Code: function index() Template Parser - El Forum - 05-06-2011 [eluser]InsiteFX[/eluser] In your View: Code: {title} InsiteFX Template Parser - El Forum - 05-06-2011 [eluser]darrentaytay[/eluser] Instead of calling: Code: $this->load->view('main', $data); You need to load the Template Parser Class and call the parse function: Code: $this->load->library('parser'); Then as InsiteFX said, use the pseudo variables in your main view. Code: {title} |