annotate core/lib/Drupal/Core/Render/ElementInfoManagerInterface.php @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents 4c8ae668cc8c
children
rev   line source
Chris@0 1 <?php
Chris@0 2
Chris@0 3 namespace Drupal\Core\Render;
Chris@0 4
Chris@0 5 use Drupal\Component\Plugin\Discovery\DiscoveryInterface;
Chris@0 6
Chris@0 7 /**
Chris@0 8 * Collects available render array element types.
Chris@0 9 */
Chris@0 10 interface ElementInfoManagerInterface extends DiscoveryInterface {
Chris@0 11
Chris@0 12 /**
Chris@0 13 * Retrieves the default properties for the defined element type.
Chris@0 14 *
Chris@0 15 * Each of the element types defined by this hook is assumed to have a
Chris@0 16 * matching theme hook, which should be registered with hook_theme() as
Chris@0 17 * normal.
Chris@0 18 *
Chris@0 19 * For more information about custom element types see the explanation at
Chris@0 20 * https://www.drupal.org/node/169815.
Chris@0 21 *
Chris@0 22 * @param string $type
Chris@0 23 * The machine name of an element type plugin.
Chris@0 24 *
Chris@0 25 * @return array
Chris@0 26 * An associative array describing the element types being defined. The
Chris@0 27 * array contains a sub-array for each element type, with the
Chris@0 28 * machine-readable type name as the key. Each sub-array has a number of
Chris@0 29 * possible attributes:
Chris@0 30 * - #input: boolean indicating whether or not this element carries a value
Chris@0 31 * (even if it's hidden).
Chris@0 32 * - #process: array of callback functions taking $element, $form_state,
Chris@0 33 * and $complete_form.
Chris@0 34 * - #after_build: array of callables taking $element and $form_state.
Chris@0 35 * - #validate: array of callback functions taking $form and $form_state.
Chris@0 36 * - #element_validate: array of callback functions taking $element and
Chris@0 37 * $form_state.
Chris@0 38 * - #pre_render: array of callables taking $element.
Chris@0 39 * - #post_render: array of callables taking $children and $element.
Chris@0 40 * - #submit: array of callback functions taking $form and $form_state.
Chris@0 41 * - #title_display: optional string indicating if and how #title should be
Chris@0 42 * displayed (see form-element.html.twig).
Chris@0 43 *
Chris@0 44 * @see \Drupal\Core\Render\Element\ElementInterface
Chris@0 45 * @see \Drupal\Core\Render\Element\ElementInterface::getInfo()
Chris@0 46 */
Chris@0 47 public function getInfo($type);
Chris@0 48
Chris@0 49 /**
Chris@0 50 * Retrieves a single property for the defined element type.
Chris@0 51 *
Chris@0 52 * @param string $type
Chris@0 53 * An element type as defined by an element plugin.
Chris@0 54 * @param string $property_name
Chris@0 55 * The property within the element type that should be returned.
Chris@0 56 * @param $default
Chris@0 57 * (Optional) The value to return if the element type does not specify a
Chris@0 58 * value for the property. Defaults to NULL.
Chris@0 59 *
Chris@0 60 * @return string
Chris@0 61 * The property value of the defined element type. Or the provided
Chris@0 62 * default value, which can be NULL.
Chris@0 63 */
Chris@0 64 public function getInfoProperty($type, $property_name, $default = NULL);
Chris@0 65
Chris@0 66 }