From: Ruby Baby Date: 2004-01-23T22:50:50+09:00 Subject: Re: Smarty template engine for Ruby - anyone interested? > Ruby Baby writes: > > Here's an idea: > > There are a lot of HTML-templating systems out there. > > Each one uses different syntax in the HTML template itself. > > That makes it hard for a company to commit to anything but > > the most popular templating system, because while a programmer > > may decide to use a Ruby instead of PHP backend, the company > > would not want the programmer's decision make them have to > > go get their HTML designer to do the templates all over again. > > Would anyone be interested in writing a Ruby parser for > > Smarty, the most popular templating engine for PHP? > > http://smarty.php.net/docs.php > > If so, my company might contribute money to help pay for the > > effort. (Not a lot, but some "extra money" to make the extra > > effort worth it.) On Fri, Jan 23, 2004 at 11:24:41AM +0300, Ed Sinjiashvili wrote: > I've used Smarty in my PHP projects. I'm quite familiar with it. > I'm also big fan of Ruby and I like your idea about porting Smarty to > Ruby. > You say that you need parser for Smarty: do you mean you want to use > it for the most common scenario: > - ruby script assigns arbitrary values to Smarty variables, like > Smarty.assign "bla-bla-bla", generate_some_stuff() > - template is very basic and just contains {$variables} > If so that's quite trivial and can be done in a couple of hours. > But Smarty is a lot smarter than that - it supports caching, plugin > system for writing custom functions, some built-in functions, etc. > That's a bigger project - to emulate/port full-blown Smarty. > Which of them do you pursue - tinymarty or Allmarty? It would have to be full-blown Smarty EXCEPT the implementation would not matter. Things like caching, I think, are behind-the-scenes implementation, and the Ruby port could decide to do that or not. The point would be to let people use their exact same HTML templates whether using Ruby or PHP as the backend.