Content-Length: 275184 | pFad | http://github.com/symfony/symfony-docs/commit/586baa04a8d34d9132767aa3022d7b64abc99824

53 [BrowserKit] Add `isFirstPage()` and `isLastPage()` methods to History · symfony/symfony-docs@586baa0 · GitHub
Skip to content

Commit 586baa0

Browse files
committed
[BrowserKit] Add isFirstPage() and isLastPage() methods to History
1 parent c7ce246 commit 586baa0

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

components/browser_kit.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,20 @@ history::
329329
// go forward to documentation page
330330
$crawler = $client->forward();
331331

332+
// check if the history position is on the first page
333+
if (!$client->history()->isFirstPage()) {
334+
$crawler = $client->back();
335+
}
336+
337+
// check if the history position is on the last page
338+
if (!$client->history()->isLastPage()) {
339+
$crawler = $client->forward();
340+
}
341+
342+
.. versionadded:: 7.4
343+
344+
The ``isFirstPage`` and ``isLastPage`` methods were introduced in Symfony 7.4.
345+
332346
You can delete the client's history with the ``restart()`` method. This will
333347
also delete all the cookies::
334348

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/symfony/symfony-docs/commit/586baa04a8d34d9132767aa3022d7b64abc99824

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy