3 namespace Drupal\Core\Render;
5 use Drupal\Component\Plugin\Discovery\DiscoveryInterface;
8 * Collects available render array element types.
10 interface ElementInfoManagerInterface extends DiscoveryInterface {
13 * Retrieves the default properties for the defined element type.
15 * Each of the element types defined by this hook is assumed to have a
16 * matching theme hook, which should be registered with hook_theme() as
19 * For more information about custom element types see the explanation at
20 * https://www.drupal.org/node/169815.
23 * The machine name of an element type plugin.
26 * An associative array describing the element types being defined. The
27 * array contains a sub-array for each element type, with the
28 * machine-readable type name as the key. Each sub-array has a number of
29 * possible attributes:
30 * - #input: boolean indicating whether or not this element carries a value
31 * (even if it's hidden).
32 * - #process: array of callback functions taking $element, $form_state,
34 * - #after_build: array of callables taking $element and $form_state.
35 * - #validate: array of callback functions taking $form and $form_state.
36 * - #element_validate: array of callback functions taking $element and
38 * - #pre_render: array of callables taking $element.
39 * - #post_render: array of callables taking $children and $element.
40 * - #submit: array of callback functions taking $form and $form_state.
41 * - #title_display: optional string indicating if and how #title should be
42 * displayed (see form-element.html.twig).
44 * @see \Drupal\Core\Render\Element\ElementInterface
45 * @see \Drupal\Core\Render\Element\ElementInterface::getInfo()
47 public function getInfo($type);
50 * Retrieves a single property for the defined element type.
53 * An element type as defined by an element plugin.
54 * @param string $property_name
55 * The property within the element type that should be returned.
57 * (Optional) The value to return if the element type does not specify a
58 * value for the property. Defaults to NULL.
61 * The property value of the defined element type. Or the provided
62 * default value, which can be NULL.
64 public function getInfoProperty($type, $property_name, $default = NULL);