Layout Engine - 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: Layout Engine (/showthread.php?tid=22330) |
Layout Engine - El Forum - 09-05-2009 [eluser]Unknown[/eluser] Hello. I'm new in CodeIgniter's world. I wanna ask for experienced CodeIgniter's users what layout engine they like to use. Also I wanna ask if I really have to load views for every controller function. For example: Code: class Blog extends Controller { Thanks. Layout Engine - El Forum - 09-05-2009 [eluser]jedd[/eluser] Hi Heliton, Quote:Also I wanna ask if I really have to load views for every controller function. You could load your header & footer views into variables, in the constructor of your Blag class - and then just echo them out in your final view. Alternatively you can extrapolate that approach up another level by extending the core controller (lookup MY_Controller in the user guide). I've rambled about this at some length [url="http://codeigniter.com/wiki/Header_and_Footer_and_Menu_on_every_page_-_jedd/"]in the wiki[/url]. Layout Engine - El Forum - 09-08-2009 [eluser]Vicente Russo[/eluser] I personaly use only one view, and inside that view, I use the include('includes/header.php') and include('includes/footer.php'). But you can add layout support like RubyOnRails into CodeIgniter Layout Engine - El Forum - 09-09-2009 [eluser]helmutbjorg[/eluser] /controllers/test.php Code: function index() { /views/template.php Code: <html> /views/index.php Code: <p>This is custom index content</p> /views/example.php Code: <p>And this is the example page content</p> Pretty easy really eh! |