Browse Source

Issue #2880398 by mChadwick29: Code cleanup.

8.x-1.x 8.x-1.8
Chi 7 years ago
parent
commit
baa7e5ef84
  1. 8
      src/TwigExtension.php

8
src/TwigExtension.php

@ -222,16 +222,16 @@ class TwigExtension extends \Twig_Extension {
* *
* @param string $form_id * @param string $form_id
* The form ID. * The form ID.
* @param ...
* Additional arguments are passed to form constructor.
* *
* @return array * @return array
* A render array to represent the form. * A render array to represent the form.
*/ */
public function drupalForm($form_id) { public function drupalForm($form_id) {
$form_builder = \Drupal::formBuilder();
$args = func_get_args(); $args = func_get_args();
// Enforcing the $form_id is always the first argument. return call_user_func_array([$form_builder, 'getForm'], $args);
$args[0] = $form_id;
$formBuilder = \Drupal::formBuilder();
return call_user_func_array(array($formBuilder, 'getForm'), $args);
} }
/** /**

Loading…
Cancel
Save