public ElementInfoManager::getInfo($type)
Retrieves the default properties for the defined element type.
Each of the form element types defined by this hook is assumed to have a matching theme hook, which should be registered with hook_theme() as normal.
For more information about custom element types see the explanation at https://www.drupal.org/node/169815.
string $type: The machine name of an element type plugin.
array An associative array describing the element types being defined. The array contains a sub-array for each element type, with the machine-readable type name as the key. Each sub-array has a number of possible attributes:
Overrides ElementInfoManagerInterface::getInfo
\Drupal\Core\Render\Element\ElementInterface
\Drupal\Core\Render\Element\ElementInterface::getInfo()
public function getInfo($type) { $theme_name = $this->themeManager->getActiveTheme()->getName(); if (!isset($this->elementInfo[$theme_name])) { $this->elementInfo[$theme_name] = $this->buildInfo($theme_name); } $info = isset($this->elementInfo[$theme_name][$type]) ? $this->elementInfo[$theme_name][$type] : array(); $info['#defaults_loaded'] = TRUE; return $info; }
© 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!lib!Drupal!Core!Render!ElementInfoManager.php/function/ElementInfoManager::getInfo/8.1.x