file PrerenderBase.php

Namespace

Drupal\bootstrap\Plugin\Prerender
  1. <?php
  2. namespace Drupal\bootstrap\Plugin\Prerender;
  3. use Drupal\bootstrap\BcSupport\TrustedCallbackInterface;
  4. use Drupal\bootstrap\Utility\Element;
  5. /**
  6. * Defines the interface for an object oriented preprocess plugin.
  7. *
  8. * @ingroup plugins_prerender
  9. */
  10. class PrerenderBase implements PrerenderInterface, TrustedCallbackInterface {
  11. /**
  12. * {@inheritdoc}
  13. */
  14. public static function preRender(array $element) {
  15. static::preRenderElement(Element::create($element));
  16. return $element;
  17. }
  18. /**
  19. * Pre-render element callback.
  20. *
  21. * @param \Drupal\bootstrap\Utility\Element $element
  22. * The element object.
  23. */
  24. public static function preRenderElement(Element $element) {}
  25. /**
  26. * {@inheritdoc}
  27. */
  28. public static function trustedCallbacks() {
  29. return ['preRender', 'preRenderElement'];
  30. }
  31. }

Classes

Name Description
PrerenderBase Defines the interface for an object oriented preprocess plugin.