file ProcessBase.php

Namespace

Drupal\bootstrap\Plugin\Process
  1. <?php
  2. namespace Drupal\bootstrap\Plugin\Process;
  3. use Drupal\bootstrap\Plugin\PluginBase;
  4. use Drupal\bootstrap\Utility\Element;
  5. use Drupal\Core\Form\FormStateInterface;
  6. /**
  7. * Base process class used to process elements.
  8. *
  9. * @ingroup plugins_process
  10. */
  11. class ProcessBase extends PluginBase implements ProcessInterface {
  12. /**
  13. * {@inheritdoc}
  14. */
  15. public static function process(array $element, FormStateInterface $form_state, array &$complete_form) {
  16. if (!empty($element['#bootstrap_ignore_process'])) {
  17. return $element;
  18. }
  19. static::processElement(Element::create($element, $form_state), $form_state, $complete_form);
  20. return $element;
  21. }
  22. /**
  23. * Process a specific form element.
  24. *
  25. * @param \Drupal\bootstrap\Utility\Element $element
  26. * The element object.
  27. * @param \Drupal\Core\Form\FormStateInterface $form_state
  28. * The current state of the form.
  29. * @param array $complete_form
  30. * The complete form structure.
  31. *
  32. * @see \Drupal\bootstrap\Plugin\Process\ProcessBase::process()
  33. * @see \Drupal\bootstrap\Plugin\Alter\ElementInfo::alter()
  34. */
  35. public static function processElement(Element $element, FormStateInterface $form_state, array &$complete_form) {}
  36. }

Classes

Name Description
ProcessBase Base process class used to process elements.