From 97e699ee4626d6a594dfa93bb2172c2ceaa7ea76 Mon Sep 17 00:00:00 2001 From: Andrey Helldar Date: Wed, 7 Nov 2018 20:03:45 +0300 Subject: [PATCH 1/5] Added return of element name in `extract()` method See a PR: symfony/symfony#29127 --- components/dom_crawler.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/components/dom_crawler.rst b/components/dom_crawler.rst index 60f6cb5186e..0a51a47c3d2 100644 --- a/components/dom_crawler.rst +++ b/components/dom_crawler.rst @@ -220,6 +220,7 @@ Extract attribute and/or node values from the list of nodes:: .. note:: Special attribute ``_text`` represents a node value. + Special attribute ``_key`` represents a node key name. Call an anonymous function on each node of the list:: From 1b261f6667b395c1c9096a0502901f4a5e8586a1 Mon Sep 17 00:00:00 2001 From: Andrey Helldar Date: Wed, 7 Nov 2018 22:42:36 +0300 Subject: [PATCH 2/5] Corrected attribute name --- components/dom_crawler.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/components/dom_crawler.rst b/components/dom_crawler.rst index 0a51a47c3d2..0a489d3f719 100644 --- a/components/dom_crawler.rst +++ b/components/dom_crawler.rst @@ -219,8 +219,7 @@ Extract attribute and/or node values from the list of nodes:: .. note:: - Special attribute ``_text`` represents a node value. - Special attribute ``_key`` represents a node key name. + Special attribute ``_text`` represents a node value and `_name`. for a element name. Call an anonymous function on each node of the list:: From 88ecb9b1d505b9144a0a358b5eefc97017d96d16 Mon Sep 17 00:00:00 2001 From: Andrey Helldar Date: Wed, 7 Nov 2018 23:41:48 +0300 Subject: [PATCH 3/5] Fixed description and updated example --- components/dom_crawler.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/dom_crawler.rst b/components/dom_crawler.rst index 0a489d3f719..ff9bf4f411d 100644 --- a/components/dom_crawler.rst +++ b/components/dom_crawler.rst @@ -214,12 +214,12 @@ Extract attribute and/or node values from the list of nodes:: $attributes = $crawler ->filterXpath('//body/p') - ->extract(array('_text', 'class')) + ->extract(array('_name', '_text', 'class')) ; .. note:: - Special attribute ``_text`` represents a node value and `_name`. for a element name. + Special attribute `_text` represents a node value, while `_name` represents element name. Call an anonymous function on each node of the list:: From e8f8c2862ea5f4c3b64cc4833708f2048445a46f Mon Sep 17 00:00:00 2001 From: Andrey Helldar Date: Wed, 7 Nov 2018 23:43:45 +0300 Subject: [PATCH 4/5] Update dom_crawler.rst --- components/dom_crawler.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/dom_crawler.rst b/components/dom_crawler.rst index ff9bf4f411d..87b5e3abb3b 100644 --- a/components/dom_crawler.rst +++ b/components/dom_crawler.rst @@ -219,7 +219,7 @@ Extract attribute and/or node values from the list of nodes:: .. note:: - Special attribute `_text` represents a node value, while `_name` represents element name. + Special attribute ``_text`` represents a node value, while ``_name`` represents element name. Call an anonymous function on each node of the list:: From e39d425bb0763be4f566a5e36357611ddcc0e636 Mon Sep 17 00:00:00 2001 From: Andrey Helldar Date: Sun, 11 Nov 2018 18:20:02 +0300 Subject: [PATCH 5/5] Update dom_crawler.rst --- components/dom_crawler.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/components/dom_crawler.rst b/components/dom_crawler.rst index 87b5e3abb3b..ffc007d6020 100644 --- a/components/dom_crawler.rst +++ b/components/dom_crawler.rst @@ -220,6 +220,7 @@ Extract attribute and/or node values from the list of nodes:: .. note:: Special attribute ``_text`` represents a node value, while ``_name`` represents element name. + Attribute ``_name`` will be added in version 4.3. Call an anonymous function on each node of the list:: 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