Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9b330ef

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#4431Less 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 fixesfdc460d Minor standard fix for best practices guide2a97453 Minor tweaka29f9fb Don't use form() helper4ef1ef3 Apply best practices to formsde4fcf4 Use AppBundle instead of AcmeStoreBundlec8ce507 Other minor fixes3c71b6d Use AppBundle instead of AcmeDemoBundle
2 parentsd203e5a +5ee9791 commit9b330ef

File tree

4 files changed

+199
-241
lines changed

4 files changed

+199
-241
lines changed

‎best_practices/forms.rst‎

Lines changed: 3 additions & 9 deletions
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)

[8]ページ先頭

©2009-2025 Movatter.jp