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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy