8000 feature #5835 Updated CssSelector code example to use the new Convert… · symfony/symfony-docs@8f24268 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8f24268

Browse files

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