Skip to content

Commit

Permalink
Updated CssSelector code example to use the new Converter
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddewie committed Oct 25, 2015
1 parent f7f9733 commit 9392f80
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions components/css_selector.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,14 @@ The CssSelector Component
~~~~~~~~~~~~~~~~~~~~~~~~~

The component's only goal is to convert CSS selectors to their XPath
equivalents::
equivalents, using :method:`Converter::toXPath() <Symfony\\Component\\CssSelector\\Converter::toXPath>`

use Symfony\Component\CssSelector\CssSelector;
.. code-block:: php
var_dump(CssSelector::toXPath('div.item > h4 > a'));
use Symfony\Component\CssSelector\Converter;
$converter = new Converter();
var_dump($converter->toXPath('div.item > h4 > a'));
This gives the following output:

Expand Down

0 comments on commit 9392f80

Please sign in to comment.