public function SearchPluginBase::searchFormAlter in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/search/src/Plugin/SearchPluginBase.php \Drupal\search\Plugin\SearchPluginBase::searchFormAlter()
Alters the search form when being built for a given plugin.
The core search module only invokes this method on active module plugins when building a form for them in \Drupal\search\Form\SearchPageForm::form(). A plugin implementing this will also need to implement the buildSearchUrlQuery() method.
Parameters
array $form: Nested array of form elements that comprise the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form. The arguments that \Drupal::formBuilder()->getForm() was originally called with are available in the array $form_state->getBuildInfo()['args'].
Overrides SearchInterface::searchFormAlter
See also
SearchInterface::buildSearchUrlQuery()
1 method overrides SearchPluginBase::searchFormAlter()
- NodeSearch::searchFormAlter in core/
modules/ node/ src/ Plugin/ Search/ NodeSearch.php - Alters the search form when being built for a given plugin.
File
- core/
modules/ search/ src/ Plugin/ SearchPluginBase.php, line 120 - Contains \Drupal\search\Plugin\SearchPluginBase.
Class
- SearchPluginBase
- Defines a base class for plugins wishing to support search.
Namespace
Drupal\search\PluginCode
public function searchFormAlter(array &$form, FormStateInterface $form_state) {
// Empty default implementation.
}