|
Posted by Moot on 04/02/07 19:29
There isn't a whole lot out there besides smarty, and you've already
said you don't like it (although it does have built-in caching to
speed up rendering, if you want it). I personally don't like smarty
because it just feels like an unnecessary scripting language on top of
another scripting language.
I still wanted to be able to separate business logic from display
logic, though, so came up with my own homebrew quasi-templating
system. I based in around the CSS Grids component of the Yahoo YUI
library (http://developer.yahoo.com/yui/grids/). It's basically just
a collection of a few classes that wrap around the css components of
that library, so I can just create a page, add blocks/grids/units,
give them whatever data they need, then just call Render() and it
takes care of structuring the html. The end result being absolutely
no html or display logic in the main file as it's delegated out to the
individual page elements. Crude, yes, but it gives me both the level
of flexibility and abstraction that I like.
Point being, that if Smarty isn't doing it for you, you may want to
think about what exactly you want from a templating system and then
just go do it yourself. The nice thing about your own templating
system is that once you have it, you'll get a lot of miles out of it
because you'll be able to reuse it for just about anything else you do.
Navigation:
[Reply to this message]
|