Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal.php \Drupal::formBuilder()
  2. 9 core/lib/Drupal.php \Drupal::formBuilder()

Returns the form builder service.

Return value

\Drupal\Core\Form\FormBuilderInterface The form builder.

43 calls to Drupal::formBuilder()
ActionsTest::testDropbuttonWithBubbleableMetadata in core/tests/Drupal/KernelTests/Core/Render/Element/ActionsTest.php
AjaxTestController::dialog in core/modules/system/tests/modules/ajax_test/src/Controller/AjaxTestController.php
Returns a render array of form elements and links for dialog.
authorize.php in core/authorize.php
Administrative script for running authorized file operations.
BatchTestController::testProgrammatic in core/modules/system/tests/modules/batch_test/src/Controller/BatchTestController.php
Submits the 'Chained' form programmatically.
CheckboxTest::testFormCheckbox in core/modules/system/tests/src/Functional/Form/CheckboxTest.php

... See full list

File

core/lib/Drupal.php, line 642

Class

Drupal
Static Service Container wrapper.

Code

public static function formBuilder() {
  return static::getContainer()
    ->get('form_builder');
}