interface ElementInfoManagerInterface

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Render/ElementInfoManagerInterface.php \Drupal\Core\Render\ElementInfoManagerInterface
  2. 10 core/lib/Drupal/Core/Render/ElementInfoManagerInterface.php \Drupal\Core\Render\ElementInfoManagerInterface
  3. 11.x core/lib/Drupal/Core/Render/ElementInfoManagerInterface.php \Drupal\Core\Render\ElementInfoManagerInterface

Collects available render array element types.

Hierarchy

Expanded class hierarchy of ElementInfoManagerInterface

All classes that implement ElementInfoManagerInterface

6 files declare their use of ElementInfoManagerInterface
AjaxRenderer.php in core/lib/Drupal/Core/Render/MainContent/AjaxRenderer.php
FileUploadForm.php in core/modules/media_library/src/Form/FileUploadForm.php
FileWidget.php in core/modules/file/src/Plugin/Field/FieldWidget/FileWidget.php
FormBuilder.php in core/lib/Drupal/Core/Form/FormBuilder.php
ImageWidget.php in core/modules/image/src/Plugin/Field/FieldWidget/ImageWidget.php

... See full list

File

core/lib/Drupal/Core/Render/ElementInfoManagerInterface.php, line 10

Namespace

Drupal\Core\Render
View source
interface ElementInfoManagerInterface extends DiscoveryInterface {
    
    /**
     * Retrieves the default properties for the defined element type.
     *
     * Each of the 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.
     *
     * @param string $type
     *   The machine name of an element type plugin.
     *
     * @return 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:
     *   - #input: boolean indicating whether or not this element carries a value
     *     (even if it's hidden).
     *   - #process: array of callback functions taking $element, $form_state,
     *     and $complete_form.
     *   - #after_build: array of callables taking $element and $form_state.
     *   - #validate: array of callback functions taking $form and $form_state.
     *   - #element_validate: array of callback functions taking $element and
     *     $form_state.
     *   - #pre_render: array of callables taking $element.
     *   - #post_render: array of callables taking $children and $element.
     *   - #submit: array of callback functions taking $form and $form_state.
     *   - #title_display: optional string indicating if and how #title should be
     *     displayed (see form-element.html.twig).
     *
     * @see \Drupal\Core\Render\Element\ElementInterface
     * @see \Drupal\Core\Render\Element\ElementInterface::getInfo()
     */
    public function getInfo($type);
    
    /**
     * Retrieves a single property for the defined element type.
     *
     * @param string $type
     *   An element type as defined by an element plugin.
     * @param string $property_name
     *   The property within the element type that should be returned.
     * @param $default
     *   (Optional) The value to return if the element type does not specify a
     *   value for the property. Defaults to NULL.
     *
     * @return mixed
     *   The property value of the defined element type. Or the provided
     *   default value, which can be NULL.
     */
    public function getInfoProperty($type, $property_name, $default = NULL);

}

Members

Title Sort descending Modifiers Object type Summary Overrides
DiscoveryInterface::getDefinition public function Gets a specific plugin definition. 2
DiscoveryInterface::getDefinitions public function Gets the definition of all plugins for this type. 1
DiscoveryInterface::hasDefinition public function Indicates if a specific plugin definition exists.
ElementInfoManagerInterface::getInfo public function Retrieves the default properties for the defined element type. 1
ElementInfoManagerInterface::getInfoProperty public function Retrieves a single property for the defined element type. 1

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