News for hackers. Stuff that matters.
Re:Practicality: PHP vs Lisp by dugmartin on Friday July 02, 2010 @07:09PM (#1482695)
This uses my company's PHP templating engine (which is open source and available at http://tierratemplates.com) and our internal CMS framework:

    // controller function
    public getcolors($request) {
      $db = CMS::GetDB();
      $request->favcolor = $db->transform($db->getRows("select * from favcolor order by color, name"), "collect", "color");
    }

    // and the template

    {@ favcolor ? 
      "<ul>"
      `<li><strong>{$key}</strong>: {$:implode(", ")}</li>`
      "</ul>" @}
the template uses a control structure called a conditerator (more info at the site). The controller uses a data transform to convert the set of rows into a hash of rows keyed on color.

I think that is more concise and reads better than the BRL example.

There are no comments on this comment yet.