NYCPHP Meetup

NYPHP.org

[nycphp-talk] Smarty templating replacement - Dwoo

John Campbell jcampbell1 at gmail.com
Wed Jun 18 12:22:56 EDT 2008


I have noticed a lot of people on the list mention Smarty, and I found
an replacement for Smarty called Dwoo that looks really promising.  It
is still beta, but I have tried it and it fixes a bunch of Smarty
problems.

The website is http://dwoo.org/

A couple of features worth mentioning:

1. Dwoo is designed to be a drop in replacement for Smarty, so in
theory, all of your existing smarty templates will work with Dwoo.
2. Dwoo supports template inheritance.
3. Dwoo can be set to treat brackets followed by a space as a literal
bracket.  This is really helpful for css/javascript.

Template inheritance is a really awesome feature that was borrowed
from the Django templating system.  Template inheritance is similar to
Symfony's slots, but more elegant and powerful.  With CakePhp, I see
crap like embedding the title and required external css/javascript
files in the controller, which is just plain wrong, but I don't know
of a good work around.  With template inheritance, it is easy for a
inner page template to modify the page title, add an additional
stylesheet, or embed javascript at the top or the bottom of the page,
while using a common master template.

I am not affiliated with this project in anyway... I just stumbled
upon it, and thought others may find it interesting.

Cheers,
-John C.



More information about the talk mailing list