Re:Lisp in Your Language
by lotyrin on Wednesday September 09, 2015 @02:43PM
(#10193333)
Drupal "theme arrays" are not entirely different. They wanted expressions covering what to be themed and how to theme those things and to allow nesting of this information - S-expr flavored PHP. I wish I knew if this had been done on purpose or if it was (just) a sad accident.
[ Parent
| on HN ]
I'll guess theme() was inspired by s-expressions, whether consciously or not. The theme() function dates from when Dries was a CS student writing a lot of the code himself.
(It's also worth noting that theme() hasn't worked this way since 2011; it now takes a more PHP-style associative array of named options.)
I'm not sure you understand. theme() appears to just be a pretty simple observable ("hookable") delegator... I mean the extreme flexibility (and great potential for large amounts of slow synchronous processing from abuse) of using nested trees of elements with '#theme' function set as passed to drupal_render().