Browse Source

Issue #2880398 by mChadwick29: Be able to add additional parameters to drupal_form

8.x-1.x
git 7 years ago committed by Chi
parent
commit
576527cabd
  1. 6
      src/TwigExtension.php

6
src/TwigExtension.php

@ -227,7 +227,11 @@ class TwigExtension extends \Twig_Extension {
* A render array to represent the form. * A render array to represent the form.
*/ */
public function drupalForm($form_id) { public function drupalForm($form_id) {
return \Drupal::formBuilder()->getForm($form_id); $args = func_get_args();
// Enforcing the $form_id is always the first argument.
$args[0] = $form_id;
$formBuilder = \Drupal::formBuilder();
return call_user_func_array(array($formBuilder, 'getForm'), $args);
} }
/** /**

Loading…
Cancel
Save