A library that implements the php-extended/php-css-selector-parser-interface interface library.
A library that implements the php-extended/php-css-selector-parser-interface interface library.
The installation of this library is made via composer.
Download composer.phar
from their website.
Then add to your composer.json :
"require": {
...
"php-extended/php-css-selector-parser-object": "^2",
...
}
Then run php composer.phar update
to install this library.
The autoloading of all classes of this library is made through composer's autoloader.
To parse css selector data, do the following :
use PhpExtended\Css\CssSelectorParser;
$parser = CssSelectorParser::get();
$node = $parser->parseString('div p:not(.foo)');
// $node is now a CssAbstractSelectorInterface
MIT (See license file).