Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. CssSelectorConverter.php

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\CssSelector

Code

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());
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal