Upgraded drupal core with security updates
[yaffs-website] / web / core / lib / Drupal / Core / Render / ElementInfoManagerInterface.php
1 <?php
2
3 namespace Drupal\Core\Render;
4
5 /**
6  * Collects available render array element types.
7  */
8 interface ElementInfoManagerInterface {
9
10   /**
11    * Retrieves the default properties for the defined element type.
12    *
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
15    * normal.
16    *
17    * For more information about custom element types see the explanation at
18    * https://www.drupal.org/node/169815.
19    *
20    * @param string $type
21    *   The machine name of an element type plugin.
22    *
23    * @return array
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,
31    *     and $complete_form.
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
35    *     $form_state.
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).
41    *
42    * @see \Drupal\Core\Render\Element\ElementInterface
43    * @see \Drupal\Core\Render\Element\ElementInterface::getInfo()
44    */
45   public function getInfo($type);
46
47   /**
48    * Retrieves a single property for the defined element type.
49    *
50    * @param string $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.
54    * @param $default
55    *   (Optional) The value to return if the element type does not specify a
56    *   value for the property. Defaults to NULL.
57    *
58    * @return string
59    *   The property value of the defined element type. Or the provided
60    *   default value, which can be NULL.
61    */
62   public function getInfoProperty($type, $property_name, $default = NULL);
63
64 }