Skip to content

Commit 9b330ef

Browse files
committed
feature #4507 Comply with best practices, Round 2 (WouterJ)
This PR was merged into the 2.3 branch. Discussion ---------- Comply with best practices, Round 2 | Q | A | --- | --- | Doc fix? | yes | New docs? | no | Applies to | all | Fixed tickets | partly #4431 Less other fixes, more find/replace this time to speed up the process. I have one question this time: * Should we just mention the use of the param converter (the current case), or update all simple controller examples to the use param converter? Commits ------- 5ee9791 Some fixes fdc460d Minor standard fix for best practices guide 2a97453 Minor tweak a29f9fb Don't use form() helper 4ef1ef3 Apply best practices to forms de4fcf4 Use AppBundle instead of AcmeStoreBundle c8ce507 Other minor fixes 3c71b6d Use AppBundle instead of AcmeDemoBundle
2 parents d203e5a + 5ee9791 commit 9b330ef

File tree

4 files changed

+199
-241
lines changed

4 files changed

+199
-241
lines changed

Diff for: best_practices/forms.rst

+3-9
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ Building Forms
1515
The Form component allows you to build forms right inside your controller
1616
code. Honestly, unless you need to reuse the form somewhere else, that's
1717
totally fine. But for organize and reuse, we recommend that you define each
18-
form in its own PHP class:
19-
20-
.. code-block:: php
18+
form in its own PHP class::
2119

2220
namespace AppBundle\Form;
2321

@@ -51,9 +49,7 @@ form in its own PHP class:
5149
}
5250
}
5351

54-
To use the class, use ``createForm`` and instantiate the new class:
55-
56-
.. code-block:: php
52+
To use the class, use ``createForm`` and instantiate the new class::
5753

5854
use AppBundle\Form\PostType;
5955
// ...
@@ -110,9 +106,7 @@ directly in your form class, this would effectively limit the scope of that form
110106
111107
This form *may* have been designed for creating posts, but if you wanted
112108
to reuse it for editing posts, the button label would be wrong. Instead,
113-
some developers configure form buttons in the controller:
114-
115-
.. code-block:: php
109+
some developers configure form buttons in the controller::
116110

117111
namespace AppBundle\Controller\Admin;
118112

0 commit comments

Comments
 (0)