function SearchPluginBase::buildSearchUrlQuery
Same name in other branches
- 9 core/modules/search/src/Plugin/SearchPluginBase.php \Drupal\search\Plugin\SearchPluginBase::buildSearchUrlQuery()
- 8.9.x core/modules/search/src/Plugin/SearchPluginBase.php \Drupal\search\Plugin\SearchPluginBase::buildSearchUrlQuery()
- 10 core/modules/search/src/Plugin/SearchPluginBase.php \Drupal\search\Plugin\SearchPluginBase::buildSearchUrlQuery()
Overrides SearchInterface::buildSearchUrlQuery
1 method overrides SearchPluginBase::buildSearchUrlQuery()
- NodeSearch::buildSearchUrlQuery in core/
modules/ node/ src/ Plugin/ Search/ NodeSearch.php - Builds the URL GET query parameters array for search.
File
-
core/
modules/ search/ src/ Plugin/ SearchPluginBase.php, line 135
Class
- SearchPluginBase
- Defines a base class for plugins wishing to support search.
Namespace
Drupal\search\PluginCode
public function buildSearchUrlQuery(FormStateInterface $form_state) {
// Grab the keywords entered in the form and put them as 'keys' in the GET.
$keys = trim($form_state->getValue('keys'));
$query = [
'keys' => $keys,
];
return $query;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.