8000 minor #10646 [DomCrawler] Added return of element name in `extract()`… · symfony/symfony-docs@e43064e · GitHub
[go: up one dir, main page]

Skip to content

Commit e43064e

Browse files
committed
minor #10646 [DomCrawler] Added return of element name in extract() method (andrey-helldar)
This PR was squashed before being merged into the master branch (closes #10646). Discussion ---------- [DomCrawler] Added return of element name in `extract()` method See a PR: symfony/symfony#29127 <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/roadmap for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `master` for features of unreleased versions). --> Commits ------- b89cd59 [DomCrawler] Added return of element name in `extract()` method
2 parents 2086b16 + b89cd59 commit e43064e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

components/dom_crawler.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,13 @@ Extract attribute and/or node values from the list of nodes::
214214

215215
$attributes = $crawler
216216
->filterXpath('//body/p')
217-
->extract(array('_text', 'class'))
217+
->extract(array('_name', '_text', 'class'))
218218
;
219219

220220
.. note::
221221

222-
Special attribute ``_text`` represents a node value.
222+
Special attribute ``_text`` represents a node value, while ``_name`` represents element name.
223+
Attribute ``_name`` will be added in version 4.3.
223224

224225
Call an anonymous function on each node of the list::
225226

0 commit comments

Comments
 (0)
0