function process_search_autocomplete in Search Autocomplete 8
Same name and namespace in other branches
- 2.x search_autocomplete.module \process_search_autocomplete()
Adds autocomplete functionality to elements.
This sets up autocomplete functionality for elements with an #autocomplete_configuration property.
Parameters
array $element: The form element to process.
Return value
array The form element.
1 string reference to 'process_search_autocomplete'
File
- ./
search_autocomplete.module, line 54 - Provides autocompletion in any field from GUI.
Code
function process_search_autocomplete(&$element) {
if (!empty($element['#autocomplete_configuration'])) {
attach_configuration_to_element($element, $element['#autocomplete_configuration']);
$element['#attributes']['class'][] = 'form-autocomplete';
$element['#attached']['library'][] = 'core/drupal.autocomplete';
$element['#attributes']['data-key'] = $element['#autocomplete_configuration'];
}
return $element;
}