public function ExampleFormEventSubscribers::alterNodeForm in Hook Event Dispatcher 3.x
Same name and namespace in other branches
- 8.2 examples/ExampleFormEventSubscribers.php \Drupal\hook_event_dispatcher\ExampleFormEventSubscribers::alterNodeForm()
Alter node form.
Parameters
\Drupal\core_event_dispatcher\Event\Form\FormBaseAlterEvent $event: The event.
File
- examples/
ExampleFormEventSubscribers.php, line 56
Class
- ExampleFormEventSubscribers
- Class ExampleFormEventSubscribers.
Namespace
Drupal\hook_event_dispatcherCode
public function alterNodeForm(FormBaseAlterEvent $event) : void {
$form =& $event
->getForm();
$form['title']['widget'][0]['value']['#title'] = 'A new title!';
}