function public static function ProcessManager::process

8.x-3.x ProcessManager.php public static ProcessManager::process(array $element, FormStateInterface $form_state, array &$complete_form)

Global process callback for form elements.

Parameters

array $element: The element render array.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

array $complete_form: The complete form structure.

Return value

array The altered element array.

Class

ProcessManager
Manages discovery and instantiation of Bootstrap form process callbacks.

Namespace

Drupal\bootstrap\Plugin

Source src/Plugin/ProcessManager.php (line 58)

public static function process(array $element, FormStateInterface $form_state, array &$complete_form) {
  if (!empty($element['#bootstrap_ignore_process'])) {
    return $element;
  }

  static $theme;
  if (!isset($theme)) {
    $theme = Bootstrap::getTheme();
  }

  $e = Element::create($element, $form_state);

  // Process AJAX.
  if (($e->getProperty('ajax') && !$e->isButton()) || $e->getProperty('autocomplete_route_name')) {
    static::processAjax($e, $form_state, $complete_form);
  }

  // Add "form-inline" class to the container.
  if ($e->hasClass('container-inline')) {
    $e->replaceClass('container-inline', 'form-inline');
  }

  // Add "form-inline" class to certain element types.
  if ($e->isType(static::getInlineElementTypes())) {
    $e->addClass('form-inline', 'wrapper_attributes');
  }

  // Process input groups.
  if ($e->getProperty('input') && ($e->getProperty('input_group') || $e->getProperty('input_group_button'))) {
    static::processInputGroups($e, $form_state, $complete_form);
  }

  return $element;
}