public function ExampleFormEventSubscribers::alterSearchForm in Hook Event Dispatcher 8
Alter search form.
Parameters
\Drupal\hook_event_dispatcher\Event\Form\FormIdAlterEvent $event: The event.
File
- src/
Example/ ExampleFormEventSubscribers.php, line 47
Class
- ExampleFormEventSubscribers
- Class ExampleFormEventSubscribers.
Namespace
Drupal\hook_event_dispatcher\ExampleCode
public function alterSearchForm(FormIdAlterEvent $event) {
$form =& $event
->getForm();
// Add placeholder.
$form['keys']['#attributes']['placeholder'] = 'Search some things';
}