Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update code to the latest helper behavior
  • Loading branch information
javiereguiluz committed Sep 23, 2021
commit fdb7b6747ec0e39d51b15537d508ab0bdcb7ab16
4 changes: 3 additions & 1 deletion controller/upload_file.rst
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,9 @@ Finally, you need to update the code of the controller that handles the form::
return $this->redirectToRoute('app_product_list');
}

return $this->renderForm('product/new.html.twig', $form);
return $this->renderForm('product/new.html.twig', [
'form' => $form,
]);
}
}

Expand Down
4 changes: 3 additions & 1 deletion form/direct_submit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ control over when exactly your form is submitted and what data is passed to it::
}
}

return $this->renderForm('task/new.html.twig', $form);
return $this->renderForm('task/new.html.twig', [
'form' => $form,
]);
}

The list of fields submitted with the ``submit()`` method must be the same as
Expand Down
4 changes: 3 additions & 1 deletion form/dynamic_form_modification.rst
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,9 @@ your application. Assume that you have a sport meetup creation controller::
// ... save the meetup, redirect etc.
}

return $this->renderForm('meetup/create.html.twig', $form);
return $this->renderForm('meetup/create.html.twig', [
'form' => $form,
]);
}

// ...
Expand Down
4 changes: 3 additions & 1 deletion form/form_collections.rst
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,9 @@ In your controller, you'll create a new form from the ``TaskType``::
// ... do your form processing, like saving the Task and Tag entities
}

return $this->renderForm('task/new.html.twig', $form);
return $this->renderForm('task/new.html.twig', [
'form' => $form,
]);
}
}

Expand Down
2 changes: 1 addition & 1 deletion form/form_customization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ enough to render an entire form, including all its fields and error messages:
.. code-block:: twig

{# form is a variable passed from the controller via either
$this->renderForm('...', $form)
$this->renderForm('...', ['form' => $form])
or $this->render('...', ['form' => $form->createView()]) #}
{{ form(form) }}

Expand Down
8 changes: 6 additions & 2 deletions forms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,9 @@ Now that the form has been created, the next step is to render it::

$form = $this->createForm(TaskType::class, $task);

return $this->renderForm('task/new.html.twig', $form);
return $this->renderForm('task/new.html.twig', [
'form' => $form,
]);
}
}

Expand Down Expand Up @@ -410,7 +412,9 @@ written into the form object::
return $this->redirectToRoute('task_success');
}

return $this->renderForm('task/new.html.twig', $form);
return $this->renderForm('task/new.html.twig', [
'form' => $form,
]);
}
}

Expand Down