function SearchInterface::buildSearchUrlQuery
Same name in other branches
- 8.9.x core/modules/search/src/Plugin/SearchInterface.php \Drupal\search\Plugin\SearchInterface::buildSearchUrlQuery()
- 10 core/modules/search/src/Plugin/SearchInterface.php \Drupal\search\Plugin\SearchInterface::buildSearchUrlQuery()
- 11.x core/modules/search/src/Plugin/SearchInterface.php \Drupal\search\Plugin\SearchInterface::buildSearchUrlQuery()
Builds the URL GET query parameters array for search.
When the search form is submitted, a redirect is generated with the search input as GET query parameters. Plugins using the searchFormAlter() method to add form elements to the search form will need to override this method to gather the form input and add it to the GET query parameters.
Parameters
\Drupal\Core\Form\FormStateInterface $form_state: The form state, with submitted form information.
Return value
array An array of GET query parameters containing all relevant form values to process the search. The 'keys' element must be present in order to trigger generation of search results, even if it is empty or unused by the search plugin.
See also
SearchInterface::searchFormAlter()
1 method overrides SearchInterface::buildSearchUrlQuery()
- SearchPluginBase::buildSearchUrlQuery in core/
modules/ search/ src/ Plugin/ SearchPluginBase.php - Builds the URL GET query parameters array for search.
File
-
core/
modules/ search/ src/ Plugin/ SearchInterface.php, line 146
Class
- SearchInterface
- Defines a common interface for all SearchPlugin objects.
Namespace
Drupal\search\PluginCode
public function buildSearchUrlQuery(FormStateInterface $form_state);
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.