You are here

public static function WebformTelephone::processWebformComposite in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/Element/WebformTelephone.php \Drupal\webform\Element\WebformTelephone::processWebformComposite()

Processes a composite webform element.

Overrides WebformCompositeBase::processWebformComposite

File

src/Element/WebformTelephone.php, line 53

Class

WebformTelephone
Provides a webform element for a telephone element.

Namespace

Drupal\webform\Element

Code

public static function processWebformComposite(&$element, FormStateInterface $form_state, &$complete_form) {
  $element = parent::processWebformComposite($element, $form_state, $complete_form);
  if (!empty($element['#phone__international']) && \Drupal::service('webform.libraries_manager')
    ->isIncluded('jquery.intl-tel-input')) {
    $element['#attached']['library'][] = 'webform/webform.telephone';
  }
  return $element;
}