File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -486,8 +486,12 @@ The :class:`Symfony\\Component\\DomCrawler\\Form` object has lots of very
486
486
useful methods for working with forms::
487
487
488
488
$uri = $form->getUri();
489
-
490
489
$method = $form->getMethod();
490
+ $name = $form->getName();
491
+
492
+ .. versionadded :: 4.4
493
+
494
+ The ``getName() `` method was introduced in Symfony 4.4.
491
495
492
496
The :method: `Symfony\\ Component\\ DomCrawler\\ Form::getUri ` method does more
493
497
than just return the ``action `` attribute of the form. If the form method
Original file line number Diff line number Diff line change @@ -804,6 +804,17 @@ their type::
804
804
$form['my_form[field][O]']->upload('/path/to/lucas.jpg');
805
805
$form['my_form[field][1]']->upload('/path/to/lisa.jpg');
806
806
807
+ .. tip ::
808
+
809
+ Instead of hardcoding the form name as part of the field names (e.g.
810
+ ``my_form[...] `` in previous examples), you can use the
811
+ :method: `Symfony\\ Component\\ DomCrawler\\ Form::getName ` method to get the
812
+ form name.
813
+
814
+ .. versionadded :: 4.4
815
+
816
+ The ``getName() `` method was introduced in Symfony 4.4.
817
+
807
818
.. tip ::
808
819
809
820
If you purposefully want to select "invalid" select/radio values, see
You can’t perform that action at this time.
0 commit comments