File tree 1 file changed +36
-0
lines changed
1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,9 @@ Select a link with the crawler and pass it to the click method to click on the l
80
80
Submiting Forms
81
81
~~~~~~~~~~~~~~~
82
82
83
+ You can submit forms with the submit method which takes a form object.
84
+ You can get the form object by using the crawler to select the button and running the form method.
85
+
83
86
.. code-block :: php
84
87
85
88
use ACME\Client;
@@ -102,6 +105,39 @@ Cookies
102
105
History
103
106
-------
104
107
108
+ The client stores all your request allowing you to go back and forward in your history.
109
+
110
+ .. code-block :: php
111
+
112
+ use ACME\Client;
113
+
114
+ // make a real request to an external site
115
+ $client = new Client();
116
+ $home_crawler = $client->request('GET', 'http://symfony.com');
117
+
118
+ // select and click on a link
119
+ $doc_link = $crawler->selectLink('Documentation')->link();
120
+ $doc_crawler = $client->click($link);
121
+
122
+ // go back to home page
123
+ $home_crawler = $client->back();
124
+
125
+ // go forward to documentation page
126
+ $doc_crawler = $client->forward();
127
+
128
+ You can restart the clients history with the restart method. This will also clear out the CookieJar.
129
+
130
+ .. code-block :: php
131
+
132
+ use ACME\Client;
133
+
134
+ // make a real request to an external site
135
+ $client = new Client();
136
+ $home_crawler = $client->request('GET', 'http://symfony.com');
137
+
138
+ // restart history
139
+ $client->restart();
140
+
105
141
Insulated Request
106
142
-----------------
107
143
You can’t perform that action at this time.
0 commit comments