Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 3 additions & 9 deletions best_practices/forms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ Building Forms
The Form component allows you to build forms right inside your controller
code. Honestly, unless you need to reuse the form somewhere else, that's
totally fine. But for organize and reuse, we recommend that you define each
form in its own PHP class:

.. code-block:: php
form in its own PHP class::

namespace AppBundle\Form;

Expand Down Expand Up @@ -51,9 +49,7 @@ form in its own PHP class:
}
}

To use the class, use ``createForm`` and instantiate the new class:

.. code-block:: php
To use the class, use ``createForm`` and instantiate the new class::

use AppBundle\Form\PostType;
// ...
Expand Down Expand Up @@ -108,9 +104,7 @@ directly in your form class, this would effectively limit the scope of that form

This form *may* have been designed for creating posts, but if you wanted
to reuse it for editing posts, the button label would be wrong. Instead,
some developers configure form buttons in the controller:

.. code-block:: php
some developers configure form buttons in the controller::

namespace AppBundle\Controller\Admin;

Expand Down
Loading