function search_embedded_form_preprocess_search_result

Same name and namespace in other branches
  1. 7.x 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. 8.9.x core/modules/search/tests/modules/search_embedded_form/search_embedded_form.module \search_embedded_form_preprocess_search_result()
  4. 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

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);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.