public function SuggestionSearchForm::submitUpdateForm in Autocomplete Search Suggestions 3.0.x
Same name and namespace in other branches
- 8.2 src/Form/SuggestionSearchForm.php \Drupal\suggestion\Form\SuggestionSearchForm::submitUpdateForm()
- 8 src/Form/SuggestionSearchForm.php \Drupal\suggestion\Form\SuggestionSearchForm::submitUpdateForm()
Ngram update submission function.
Parameters
array $form: A drupal form array.
Drupal\Core\Form\FormStateInterface $form_state: A Drupal form state object.
File
- src/
Form/ SuggestionSearchForm.php, line 173
Class
- SuggestionSearchForm
- Ngram search form.
Namespace
Drupal\suggestion\FormCode
public function submitUpdateForm(array &$form, FormStateInterface $form_state) {
$src = Helper::optionBits((array) $form_state
->getValue('src'));
foreach ((array) $form_state
->getValue('list') as $ngram => $val) {
if (!$val) {
continue;
}
Helper::updateSrc($ngram, $src);
$this
->messenger()
->addStatus($this
->t('Updated: “@ngram”', [
'@ngram' => $ngram,
]));
}
}