File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -518,11 +518,13 @@ The :class:`Symfony\\Component\\DomCrawler\\Form` object has lots of very
518
518
useful methods for working with forms::
519
519
520
520
$uri = $form->getUri();
521
-
522
521
$method = $form->getMethod();
523
-
524
522
$name = $form->getName();
525
523
524
+ .. versionadded :: 4.4
525
+
526
+ The ``getName() `` method was introduced in Symfony 4.4.
527
+
526
528
The :method: `Symfony\\ Component\\ DomCrawler\\ Form::getUri ` method does more
527
529
than just return the ``action `` attribute of the form. If the form method
528
530
is GET, then it mimics the browser's behavior and returns the ``action ``
Original file line number Diff line number Diff line change @@ -814,9 +814,14 @@ their type::
814
814
815
815
.. tip ::
816
816
817
- All field names in forms generated by Symfony are prefixed with the form's name.
818
- If the name is autogenerated you can get it using
819
- :method: `Symfony\\ Component\\ DomCrawler\\ Form::getName ` method.
817
+ Instead of hardcoding the form name as part of the field names (e.g.
818
+ ``my_form[...] `` in previous examples), you can use the
819
+ :method: `Symfony\\ Component\\ DomCrawler\\ Form::getName ` method to get the
820
+ form name.
821
+
822
+ .. versionadded :: 4.4
823
+
824
+ The ``getName() `` method was introduced in Symfony 4.4.
820
825
821
826
.. tip ::
822
827
You can’t perform that action at this time.
0 commit comments