8000 Add documentation about children method in DomCrawelr · symfony/symfony-docs@cbb057f · GitHub
[go: up one dir, main page]

Skip to content

Commit cbb057f

Browse files
Einenlumjaviereguiluz
authored andcommitted
Add documentation about children method in DomCrawelr
1 parent 8a88478 commit cbb057f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

components/dom_crawler.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,13 @@ Get all the child or parent nodes::
182182
$crawler->filter('body')->children();
183183
$crawler->filter('body > p')->parents();
184184

185+
Get all the direct child nodes matching a CSS selector::
186+
187+
$crawler->filter('body')->children('p.lorem');
188+
189+
.. versionadded:: 4.2
190+
The optional selector in ``children($selector)`` method was introduced in Symfony 4.2.
191+
185192
.. note::
186193

187194
All the traversal methods return a new :class:`Symfony\\Component\\DomCrawler\\Crawler`

0 commit comments

Comments
 (0)
0