You are here

function search_embedded_form_preprocess_search_result in Drupal 8

Same name and namespace in other branches
  1. 7 modules/search/tests/search_embedded_form.module \search_embedded_form_preprocess_search_result()
  2. 9 core/modules/search/tests/modules/search_embedded_form/search_embedded_form.module \search_embedded_form_preprocess_search_result()
  3. 10 core/modules/search/tests/modules/search_embedded_form/search_embedded_form.module \search_embedded_form_preprocess_search_result()

Adds the test form to search results.

File

core/modules/search/tests/modules/search_embedded_form/search_embedded_form.module, line 15
Test module implementing a form that can be embedded in search results.

Code

function search_embedded_form_preprocess_search_result(&$variables) {
  $form = \Drupal::formBuilder()
    ->getForm('Drupal\\search_embedded_form\\Form\\SearchEmbeddedForm');
  $variables['snippet'] = array_merge($variables['snippet'], $form);
}