You are here

public function TwigExtension::drupalForm in Twig Tweak 8.2

Same name and namespace in other branches
  1. 8 src/TwigExtension.php \Drupal\twig_tweak\TwigExtension::drupalForm()

Builds and processes a form for a given form ID.

Parameters

string $form_id: The form ID.

...: Additional arguments are passed to form constructor.

Return value

array A render array to represent the form.

File

src/TwigExtension.php, line 750

Class

TwigExtension
Twig extension with some useful functions and filters.

Namespace

Drupal\twig_tweak

Code

public function drupalForm($form_id) {
  $callback = [
    \Drupal::formBuilder(),
    'getForm',
  ];
  return call_user_func_array($callback, func_get_args());
}