From 0947d86b4a1f99e5f539b1b6dfbfcd36235445a9 Mon Sep 17 00:00:00 2001 From: Arvydas K Date: Tue, 30 May 2017 22:17:53 +0300 Subject: [PATCH 1/5] Edited to show more ways, to get crawler form --- components/dom_crawler.rst | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/components/dom_crawler.rst b/components/dom_crawler.rst index 6ddd29daa16..795b92da46f 100644 --- a/components/dom_crawler.rst +++ b/components/dom_crawler.rst @@ -396,10 +396,19 @@ given text. This method is especially useful because you can use it to return a :class:`Symfony\\Component\\DomCrawler\\Form` object that represents the form that the button lives in:: - $form = $crawler->selectButton('validate')->form(); + // button example: + + // you can get button my it's name + $form = $crawler->selectButton('My awesome button!')->form(); + + // or by by button id (#my-super-button) if button don't have name + $form = $crawler->selectButton('my-super-button')->form(); + + // or you can filter whole form + $crawler->filter('.form-vertical')->form(); // or "fill" the form fields with data - $form = $crawler->selectButton('validate')->form(array( + $form = $crawler->selectButton('my-super-button')->form(array( 'name' => 'Ryan', )); From e30506953b8b5f0b7b3d8c8a9b9e384610cfd5d8 Mon Sep 17 00:00:00 2001 From: Arvydas K Date: Tue, 30 May 2017 22:23:29 +0300 Subject: [PATCH 2/5] Small typo fix --- components/dom_crawler.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/dom_crawler.rst b/components/dom_crawler.rst index 795b92da46f..6474b61577c 100644 --- a/components/dom_crawler.rst +++ b/components/dom_crawler.rst @@ -399,7 +399,7 @@ form that the button lives in:: // button example: // you can get button my it's name - $form = $crawler->selectButton('My awesome button!')->form(); + $form = $crawler->selectButton('My super button')->form(); // or by by button id (#my-super-button) if button don't have name $form = $crawler->selectButton('my-super-button')->form(); From 80815ebe999923dcb1ce0df86477867bfdcb471f Mon Sep 17 00:00:00 2001 From: Arvydas K Date: Mon, 19 Jun 2017 22:06:20 +0300 Subject: [PATCH 3/5] Small misspelling fixes --- components/dom_crawler.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/dom_crawler.rst b/components/dom_crawler.rst index 6474b61577c..5dafde844d4 100644 --- a/components/dom_crawler.rst +++ b/components/dom_crawler.rst @@ -398,13 +398,13 @@ form that the button lives in:: // button example: - // you can get button my it's name + // you can get button my its name $form = $crawler->selectButton('My super button')->form(); - // or by by button id (#my-super-button) if button don't have name + // or by button id (#my-super-button) if button doesn't have a name $form = $crawler->selectButton('my-super-button')->form(); - // or you can filter whole form + // or you can filter whole form, for example a form has a class attribute:
$crawler->filter('.form-vertical')->form(); // or "fill" the form fields with data From 48130f0169d23fd5746ec6dcc5a29f6b1024f2e1 Mon Sep 17 00:00:00 2001 From: Arvydas K Date: Tue, 27 Jun 2017 22:13:19 +0300 Subject: [PATCH 4/5] Changed text how to get button label --- components/dom_crawler.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/dom_crawler.rst b/components/dom_crawler.rst index 5dafde844d4..06d36afe547 100644 --- a/components/dom_crawler.rst +++ b/components/dom_crawler.rst @@ -398,10 +398,10 @@ form that the button lives in:: // button example: - // you can get button my its name + // you can get button my its label $form = $crawler->selectButton('My super button')->form(); - // or by button id (#my-super-button) if button doesn't have a name + // or by button id (#my-super-button) if button doesn't have a label $form = $crawler->selectButton('my-super-button')->form(); // or you can filter whole form, for example a form has a class attribute: From bccfe9d17f0d9d39549f3aee9994be03f42329cd Mon Sep 17 00:00:00 2001 From: Arvydas K Date: Thu, 29 Jun 2017 21:22:44 +0300 Subject: [PATCH 5/5] Small mistype edits --- components/dom_crawler.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/dom_crawler.rst b/components/dom_crawler.rst index 06d36afe547..616d0ada91f 100644 --- a/components/dom_crawler.rst +++ b/components/dom_crawler.rst @@ -398,13 +398,13 @@ form that the button lives in:: // button example: - // you can get button my its label + // you can get button by its label $form = $crawler->selectButton('My super button')->form(); - // or by button id (#my-super-button) if button doesn't have a label + // or by button id (#my-super-button) if the button doesn't have a label $form = $crawler->selectButton('my-super-button')->form(); - // or you can filter whole form, for example a form has a class attribute: + // or you can filter the whole form, for example a form has a class attribute: $crawler->filter('.form-vertical')->form(); // or "fill" the form fields with data