Arrays of Doom: Understanding and Using Render Arrays
Behind every Drupal 8 template is a render array. Actually, quite often a large number of render arrays. They aren't new in Drupal 8, but they're more prevalent than ever. And while they may be Drupal's infamous "arrays of doom", they provide incredible flexibility. Unfortunately, with great flexibility comes great difficulty in understanding.
All Drupal developers need to understand render arrays. Back-end developers will need to use them to extend core and contrib code, as well as when writing extendible code of their own. Front-end developers will need to use and dissect them in Twig templates and preprocess functions.
This session will remove the confusion and intimidation around render arrays by covering:
- what render arrays are and how they work
- best practices for using render arrays in a sustainable way
- other tips and tricks, such as attaching assets and caching
Previous experience with the theme system will make this session easier to follow.