public Toolbar::getInfo()
Returns the element properties for this element.
Return value
array An array of element properties. See \Drupal\Core\Render\ElementInfoManagerInterface::getInfo() for documentation of the standard properties of all elements, and the return value format.
Overrides ElementInterface::getInfo
File
- core/modules/toolbar/src/Element/Toolbar.php, line 19
Class
- Toolbar
- Provides a render element for the default Drupal toolbar.
Namespace
Drupal\toolbar\Element
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | public function getInfo() { $class = get_class( $this ); return array ( '#pre_render' => array ( array ( $class , 'preRenderToolbar' ), ), '#theme' => 'toolbar' , '#attached' => array ( 'library' => array ( 'toolbar/toolbar' , ), ), // Metadata for the toolbar wrapping element. '#attributes' => array ( // The id cannot be simply "toolbar" or it will clash with the // simpletest tests listing which produces a checkbox with attribute // id="toolbar". 'id' => 'toolbar-administration' , 'role' => 'group' , 'aria-label' => $this ->t( 'Site administration toolbar' ), ), // Metadata for the administration bar. '#bar' => array ( '#heading' => $this ->t( 'Toolbar items' ), '#attributes' => array ( 'id' => 'toolbar-bar' , 'role' => 'navigation' , 'aria-label' => $this ->t( 'Toolbar items' ), ), ), ); } |
Please login to continue.