function toolbar_get_rendered_subtrees
toolbar_get_rendered_subtrees()
Returns the rendered subtree of each top-level toolbar link.
Return value
array An array with the following key-value pairs:
- 'subtrees': the rendered subtrees
- 'cacheability: the associated cacheability.
File
- core/modules/toolbar/toolbar.module, line 287
- Administration toolbar for quick access to top level administration items.
Code
function toolbar_get_rendered_subtrees() { $data = [ '#pre_render' => ['_toolbar_do_get_rendered_subtrees'], '#cache' => [ 'keys' => [ 'toolbar_rendered_subtrees', ], ], '#cache_properties' => ['#subtrees'], ]; \Drupal::service('renderer')->renderPlain($data); return [$data['#subtrees'], CacheableMetadata::createFromRenderArray($data)]; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!modules!toolbar!toolbar.module/function/toolbar_get_rendered_subtrees/8.1.x