Skip to content

Commit

Permalink
feature #5835 Updated CssSelector code example to use the new Convert…
Browse files Browse the repository at this point in the history
…er (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
  • Loading branch information
weaverryan committed Nov 5, 2015
2 parents 62d9a15 + dfb9b16 commit 8f24268
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions components/css_selector.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@ The CssSelector Component
~~~~~~~~~~~~~~~~~~~~~~~~~

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

use Symfony\Component\CssSelector\CssSelector;
use Symfony\Component\CssSelector\CssSelectorConverter;

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

This gives the following output:

Expand Down

0 comments on commit 8f24268

Please sign in to comment.