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

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
weaverryan merged 8 commits intosymfony:2.3fromwouterj:4431_batch_2
Dec 7, 2014
Merged
Show file tree
Hide file tree
Changes fromall 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 deletionsbest_practices/forms.rst
View file
Open in desktop
Original file line numberDiff line numberDiff 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 DownExpand 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 DownExpand 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

[8]ページ先頭

©2009-2025 Movatter.jp