Permalink
Browse files

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
  • Loading branch information...
weaverryan committed Dec 7, 2014
2 parents d203e5a + 5ee9791 commit 9b330efdf38ee568cd7b6e5cf7aada74c9a3e511
Showing with 199 additions and 241 deletions.
  1. +3 −9 best_practices/forms.rst
  2. +75 −84 book/doctrine.rst
  3. +98 −115 book/forms.rst
  4. +23 −33 book/http_fundamentals.rst
@@ -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;
@@ -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;
// ...
@@ -110,9 +106,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;
Oops, something went wrong.

0 comments on commit 9b330ef

Please sign in to comment.