#theme recommended for specifying theme function mentions "#properties" which is probably confusing to a lot of people (even me at first). Perhaps something like "by providing #-style properties" would be clearer.

Comments

jhodgdon’s picture

Definitely confusing! This item says:

Now that menu callbacks should return arrays, we encourage renderable elements to use #theme to specify a theme function instead of using #markup => theme('foo', ...). This delays theming until later which gives hook_page_alter() a chance to make changes. Note that you may pass parameters to theme() by creating #properties that match the name of the theme function parameter. Note that this feature applies to theme functions, not theme templates.

Can anyone clarify what "creating #properties that match the name of the theme function parameter" means, or give an example, so we can make this clearer? I really have no idea what it means.

jhodgdon’s picture

Status: Active » Closed (duplicate)

Actually, I just reopened the original issue so that the people who created the patch, wrote the doc, etc. can fix it:
#373201: Enhance drupal_render() themeing. Return renderable array on tracker page.

Closing this issue as a duplicate.