mirror of
https://github.com/symfony/symfony-docs.git
synced 2026-03-24 00:32:14 +01:00
Merge branch '6.4' into 7.2
* 6.4: [DomCrawler] Replace parents() by ancestors()
This commit is contained in:
@@ -10,11 +10,11 @@ Traversing
|
||||
|
||||
Like jQuery, the Crawler has methods to traverse the DOM of an HTML/XML
|
||||
document. For example, the following finds all ``input[type=submit]`` elements,
|
||||
selects the last one on the page, and then selects its immediate parent element::
|
||||
selects the last one on the page, and then selects its immediate ancestor element::
|
||||
|
||||
$newCrawler = $crawler->filter('input[type=submit]')
|
||||
->last()
|
||||
->parents()
|
||||
->ancestors()
|
||||
->first()
|
||||
;
|
||||
|
||||
@@ -36,8 +36,8 @@ Many other methods are also available:
|
||||
All following siblings.
|
||||
``previousAll()``
|
||||
All preceding siblings.
|
||||
``parents()``
|
||||
Returns the parent nodes.
|
||||
``ancestors()``
|
||||
Returns the ancestor nodes.
|
||||
``children()``
|
||||
Returns children nodes.
|
||||
``reduce($lambda)``
|
||||
|
||||
Reference in New Issue
Block a user