Layout Class |
[eluser]John Nickell[/eluser]
Greetings all, I am still fairly new to CodeIgniter, but I love what I've been able to do with it so far. Hopefully my first CodeIgniter library can help someone else, as well. I know that CodeIgniter already has the ability to load view partials. Also, after looking at some of the templating engines out there, I decided that I wanted to stick with PHP. I was still hoping for some furthur structure/separation. This library was inspired by: 1. The NetTuts+ tutorial about creating a Layout Manager: http://net.tutsplus.com/tutorials/php/ho...-tutorial/ 2. ASP.NET Master Pages 3. My previous experiences with templating solutions The syntax I was looking for amounted to this: Controller: Code: <?php Layout: Code: <?php print $this->layout->html('doctype'); ?> The final result is slightly different, but works very well for me so far. If anyone here might get some use out of it, check it out here: https://github.com/johnnickell/Layout-Class Please let me know if you would have done it differently. Any feedback positive or negative is appreciated. Thanks! John Nickell |
Welcome Guest, Not a member yet? Register Sign In |