Skip to content

Comply with best practices, Round 2 #4507

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

Merged
merged 8 commits into from
Dec 7, 2014
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