You are here

public static function EntityAutocomplete::afterBuildEntityAutocomplete in YAML Form 8

Form API callback. After build set the #element_validate handler.

File

src/Plugin/YamlFormElement/EntityAutocomplete.php, line 85

Class

EntityAutocomplete
Provides a 'entity_autocomplete' element.

Namespace

Drupal\yamlform\Plugin\YamlFormElement

Code

public static function afterBuildEntityAutocomplete(array $element, FormStateInterface $form_state) {
  $element['#element_validate'][] = [
    '\\Drupal\\yamlform\\Plugin\\YamlFormElement\\EntityAutocomplete',
    'validateEntityAutocomplete',
  ];
  return $element;
}