Skip to content

Commit 9392f80

Browse files
committed
Updated CssSelector code example to use the new Converter
1 parent f7f9733 commit 9392f80

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Diff for: components/css_selector.rst

+6-3
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,14 @@ 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:`Converter::toXPath() <Symfony\\Component\\CssSelector\\Converter::toXPath>`
5151

52-
use Symfony\Component\CssSelector\CssSelector;
52+
.. code-block:: php
5353
54-
var_dump(CssSelector::toXPath('div.item > h4 > a'));
54+
use Symfony\Component\CssSelector\Converter;
55+
56+
$converter = new Converter();
57+
var_dump($converter->toXPath('div.item > h4 > a'));
5558
5659
This gives the following output:
5760

0 commit comments

Comments
 (0)