File tree Expand file tree Collapse file tree 4 files changed +13
-5
lines changed
Filter options
reference/forms/types/options Expand file tree Collapse file tree 4 files changed +13
-5
lines changed
Original file line number Diff line number Diff line change @@ -227,7 +227,7 @@ controller::
227
227
The :method: `Symfony\C omponent\F orm\F ormInterface::handleRequest ` method was
228
228
added in Symfony 2.3. Previously, the ``$request `` was passed to the
229
229
``submit `` method - a strategy which is deprecated and will be removed
230
- in Symfony 3.0. For details on that method, see :doc: ` / cookbook/ form/direct_submit `.
230
+ in Symfony 3.0. For details on that method, see :ref: ` cookbook- form-submit-request `.
231
231
232
232
This controller follows a common pattern for handling forms, and has three
233
233
possible paths:
Original file line number Diff line number Diff line change 4
4
How to use the submit() Function to handle Form Submissions
5
5
===========================================================
6
6
7
+ .. versionadded ::
8
+ Before Symfony 2.3, the ``submit `` method was known as ``bind ``.
9
+
7
10
In Symfony 2.3, a new :method: `Symfony\C omponent\F orm\F ormInterface::handleRequest `
8
11
method was added, which makes handling form submissions easier than ever::
9
12
@@ -75,11 +78,16 @@ method, pass the submitted data directly to
75
78
76
79
$form->get('firstName')->submit('Fabien');
77
80
81
+ .. _cookbook-form-submit-request :
82
+
78
83
Passing a Request to Form::submit() (deprecated)
79
84
------------------------------------------------
80
85
86
+ .. versionadded ::
87
+ Before Symfony 2.3, the ``submit `` method was known as ``bind ``.
88
+
81
89
Before Symfony 2.3, the :method: `Symfony\C omponent\F orm\F ormInterface::submit `
82
- method accepted a :class: `Symfony\\ Component\\ HttpFoundation\\ Reuqest ` object as
90
+ method accepted a :class: `Symfony\\ Component\\ HttpFoundation\\ Request ` object as
83
91
a convenient shortcut to the previous example::
84
92
85
93
use Symfony\Component\HttpFoundation\Request;
Original file line number Diff line number Diff line change 87
87
* :doc:` /cookbook/form/inherit_data_option`
88
88
* :doc:` /cookbook/form/unit_testing`
89
89
* :doc:` /cookbook/form/use_empty_data`
90
- * :doc:` /cookbook/form/direct_bind `
90
+ * :doc:` /cookbook/form/direct_submit `
91
91
* (validation) :doc:` /cookbook/validation/custom_constraint`
92
92
* (doctrine) :doc:` /cookbook/doctrine/file_uploads`
93
93
Original file line number Diff line number Diff line change @@ -20,15 +20,15 @@ To explain this further, here's a simple example::
20
20
)
21
21
22
22
If ``by_reference`` is true, the following takes place behind the scenes
23
- when you call ``bind`` on the form::
23
+ when you call ``submit`` (or ``handleRequest``) on the form::
24
24
25
25
$article->setTitle('...');
26
26
$article->getAuthor()->setName('...');
27
27
$article->getAuthor()->setEmail('...');
28
28
29
29
Notice that ``setAuthor`` is not called. The author is modified by reference.
30
30
31
- If you set ``by_reference`` to false, binding looks like this::
31
+ If you set ``by_reference`` to false, submitting looks like this::
32
32
33
33
$article->setTitle('...');
34
34
$author = $article->getAuthor();
You can’t perform that action at this time.
0 commit comments