3 ms·
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
by lotyrin 11y ago
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.
- ksenzee 11y agoI'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.)
- lotyrin 11y agoI'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().