Skip to content

Commit 8f24268

Browse files
committed
feature #5835 Updated CssSelector code example to use the new Converter (hiddewie)
This PR was merged into the 2.8 branch. Discussion ---------- Updated CssSelector code example to use the new Converter | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.8 | Fixed tickets | #5782 Commits ------- dfb9b16 Used :: for code block df4fc7e Updated for CssSelectorConverter class name 9392f80 Updated CssSelector code example to use the new Converter
2 parents 62d9a15 + dfb9b16 commit 8f24268

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

components/css_selector.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,12 @@ The CssSelector Component
4747
~~~~~~~~~~~~~~~~~~~~~~~~~
4848

4949
The component's only goal is to convert CSS selectors to their XPath
50-
equivalents::
50+
equivalents, using :method:`Symfony\\Component\\CssSelector\\CssSelectorConverter::toXPath`::
5151

52-
use Symfony\Component\CssSelector\CssSelector;
52+
use Symfony\Component\CssSelector\CssSelectorConverter;
5353

54-
var_dump(CssSelector::toXPath('div.item > h4 > a'));
54+
$converter = new CssSelectorConverter();
55+
var_dump($converter->toXPath('div.item > h4 > a'));
5556

5657
This gives the following output:
5758

0 commit comments

Comments
 (0)
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