8000 Add documentation about children method in DomCrawelr by Einenlum · Pull Request #10310 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Add documentation about children method in DomCrawelr #10310

8000 New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add documentation about children method in DomCrawelr
  • Loading branch information
Einenlum committed Sep 10, 2018
commit 7dce081eca8ea7fb934bda9623a24784d0647b68
4 changes: 4 additions & 0 deletions components/dom_crawler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ Get all the child or parent nodes::
$crawler->filter('body')->children();
$crawler->filter('body > p')->parents();

Get all the direct child nodes matching a CSS selector::

$crawler->filter('body')->children('p.lorem');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just asking: why is this different than $crawler->filter('body > p.lorem'); Thanks!

Also, we'll need to add the following after this new content:

.. versionadded:: 4.2
    The ``children()`` method was introduced in Symfony 4.2.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@javiereguiluz It's not different than $crawler->filter('body > p.lorem');, it's just that it was not possible before to get the same result directly from the body node.

You can see more details about the problem that was solved, here.


.. note::

All the traversal methods return a new :class:`Symfony\\Component\\DomCrawler\\Crawler`
Expand Down
0