3 namespace Drupal\Core\Render;
6 * Collects available render array element types.
8 interface ElementInfoManagerInterface {
11 * Retrieves the default properties for the defined element type.
13 * Each of the element types defined by this hook is assumed to have a
14 * matching theme hook, which should be registered with hook_theme() as
17 * For more information about custom element types see the explanation at
18 * https://www.drupal.org/node/169815.
21 * The machine name of an element type plugin.
24 * An associative array describing the element types being defined. The
25 * array contains a sub-array for each element type, with the
26 * machine-readable type name as the key. Each sub-array has a number of
27 * possible attributes:
28 * - #input: boolean indicating whether or not this element carries a value
29 * (even if it's hidden).
30 * - #process: array of callback functions taking $element, $form_state,
32 * - #after_build: array of callables taking $element and $form_state.
33 * - #validate: array of callback functions taking $form and $form_state.
34 * - #element_validate: array of callback functions taking $element and
36 * - #pre_render: array of callables taking $element.
37 * - #post_render: array of callables taking $children and $element.
38 * - #submit: array of callback functions taking $form and $form_state.
39 * - #title_display: optional string indicating if and how #title should be
40 * displayed (see form-element.html.twig).
42 * @see \Drupal\Core\Render\Element\ElementInterface
43 * @see \Drupal\Core\Render\Element\ElementInterface::getInfo()
45 public function getInfo($type);
48 * Retrieves a single property for the defined element type.
51 * An element type as defined by an element plugin.
52 * @param string $property_name
53 * The property within the element type that should be returned.
55 * (Optional) The value to return if the element type does not specify a
56 * value for the property. Defaults to NULL.
59 * The property value of the defined element type. Or the provided
60 * default value, which can be NULL.
62 public function getInfoProperty($type, $property_name, $default = NULL);