You are here

public function SearchForm::submitForm in Google Search Appliance 8

Form submission handler.

Parameters

array $form: An associative array containing the structure of the form.

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

Overrides FormInterface::submitForm

File

src/Form/SearchForm.php, line 62

Class

SearchForm
Provides the search form.

Namespace

Drupal\google_appliance\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $searchQuery = urlencode($form_state
    ->getValue('search_keys'));
  $form_state
    ->setRedirect(SearchViewRoute::ROUTE_NAME, [
    'search_query' => $searchQuery,
  ]);
}