File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 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
8080 Submiting Forms
8181~~~~~~~~~~~~~~~
8282
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+
8386.. code-block :: php
8487
8588 use ACME\Client;
@@ -102,6 +105,39 @@ Cookies
102105History
103106-------
104107
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+
105141 Insulated Request
106142-----------------
107143
You can’t perform that action at this time.
0 commit comments