New library for doing "template inheritance" *without* a template parser |
[eluser]arshaw[/eluser]
Hello all! I've always found django's template inheritance to be invaluable when organizing my template code. I've always wanted the same in PHP, but without a cumbersome template parser like smarty. I've just developed a library to do this in pure PHP: PHP Template Inheritance Internally, it uses output buffers, but its API is very simple and easy to use. For example, here is a "parent" template: Code: <html> and here is the "child" template: Code: <? include 'parent.php' ?> and here is what it outputs: Code: <html> I really think this would be useful in CodeIgniter, which I praise for its lack of template engine (by default), and going the straight PHP route for view code. I'd love to hear what you guys think, and whether you think it'd be appropriate to include this in a codeigniter distro. |
Messages In This Thread |
New library for doing "template inheritance" *without* a template parser - by El Forum - 03-29-2010, 10:26 PM
New library for doing "template inheritance" *without* a template parser - by El Forum - 04-07-2010, 03:07 PM
New library for doing "template inheritance" *without* a template parser - by El Forum - 04-07-2010, 08:40 PM
New library for doing "template inheritance" *without* a template parser - by El Forum - 04-13-2010, 01:29 AM
New library for doing "template inheritance" *without* a template parser - by El Forum - 05-13-2010, 12:58 AM
New library for doing "template inheritance" *without* a template parser - by El Forum - 05-16-2010, 08:24 PM
New library for doing "template inheritance" *without* a template parser - by El Forum - 05-17-2010, 05:07 PM
New library for doing "template inheritance" *without* a template parser - by El Forum - 06-12-2014, 04:58 AM
|