function element_info

Same name in other branches
  1. 7.x includes/common.inc \element_info()

Retrieves the default properties for the defined element type.

Parameters

$type: An element type as defined by an element plugin.

Deprecated

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal::service('element_info')->getInfo() instead.

See also

https://www.drupal.org/node/2235461

8 string references to 'element_info'
BrokenCacheUpdateTest::testUpdate in core/modules/system/tests/src/Functional/UpdateSystem/BrokenCacheUpdateTest.php
Ensures that a broken or out-of-date element info cache is not used.
ElementInfoManager::__construct in core/lib/Drupal/Core/Render/ElementInfoManager.php
Constructs a ElementInfoManager object.
FileUploadForm::create in core/modules/media_library/src/Form/FileUploadForm.php
Instantiates a new instance of this class.
FileWidget::create in core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php
Creates an instance of the plugin.
KernelTestBaseTest::testRender in core/tests/Drupal/KernelTests/KernelTestBaseTest.php
@covers ::render

... See full list

File

core/includes/common.inc, line 950

Code

function element_info($type) {
    return \Drupal::service('element_info')->getInfo($type);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.