function CssSelectorConverter::__construct
Parameters
bool $html Whether HTML support should be enabled. Disable it for XML documents:
File
-
vendor/
symfony/ css-selector/ CssSelectorConverter.php, line 38
Class
- CssSelectorConverter
- CssSelectorConverter is the main entry point of the component and can convert CSS selectors to XPath expressions.
Namespace
Symfony\Component\CssSelectorCode
public function __construct(bool $html = true) {
$this->translator = new Translator();
if ($html) {
$this->translator
->registerExtension(new HtmlExtension($this->translator));
$this->cache =& self::$htmlCache;
}
else {
$this->cache =& self::$xmlCache;
}
$this->translator
->registerParserShortcut(new EmptyStringParser())
->registerParserShortcut(new ElementParser())
->registerParserShortcut(new ClassParser())
->registerParserShortcut(new HashParser());
}