Skip to content

Simplified the form theming docs #10926

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
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
2 changes: 2 additions & 0 deletions _build/redirection_map
Original file line number Diff line number Diff line change
Expand Up @@ -403,3 +403,5 @@
/frontend/encore/installation-no-flex /frontend/encore/installation
/http_cache/form_csrf_caching /security/csrf
/console/logging /console
/reference/forms/twig_reference /form/form_customization
/form/rendering /form/form_customization
1 change: 1 addition & 0 deletions _images/form/form-field-parts.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _images/sources/form/form-field-parts.dia
Binary file not shown.
11 changes: 6 additions & 5 deletions components/form.rst
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,9 @@ between Twig and several Symfony components:

$ composer require symfony/twig-bridge

The TwigBridge integration provides you with several :doc:`Twig Functions </reference/forms/twig_reference>`
that help you render the HTML widget, label and error for each field
The TwigBridge integration provides you with several
:ref:`Twig Functions <reference-form-twig-functions-variables>`
that help you render the HTML widget, label, help and error for each field
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about errors instead of error ?

(as well as a few other things). To configure the integration, you'll need
to bootstrap or access Twig and add the :class:`Symfony\\Bridge\\Twig\\Extension\\FormExtension`::

Expand Down Expand Up @@ -510,8 +511,8 @@ Rendering the Form

Now that the form has been created, the next step is to render it. This is
done by passing a special form "view" object to your template (notice the
``$form->createView()`` in the controller above) and using a set of form
helper functions:
``$form->createView()`` in the controller above) and using a set of
:ref:`form helper functions <reference-form-twig-functions>`:

.. code-block:: html+twig

Expand All @@ -528,7 +529,7 @@ That's it! By printing ``form_widget(form)``, each field in the form is
rendered, along with a label and error message (if there is one). While this is
convenient, it's not very flexible (yet). Usually, you'll want to render each
form field individually so you can control how the form looks. You'll learn how
to do that in the ":doc:`/form/rendering`" section.
to do that in the :doc:`form customization </form/form_customization>" article.

Changing a Form's Method and Action
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
Loading