function AttributeMatchingExtension::translateDashMatch
1 call to AttributeMatchingExtension::translateDashMatch()
- AttributeMatchingExtension::getAttributeMatchingTranslators in vendor/
symfony/ css-selector/ XPath/ Extension/ AttributeMatchingExtension.php - Returns attribute operation translators.
File
-
vendor/
symfony/ css-selector/ XPath/ Extension/ AttributeMatchingExtension.php, line 62
Class
- AttributeMatchingExtension
- XPath expression translator attribute extension.
Namespace
Symfony\Component\CssSelector\XPath\ExtensionCode
public function translateDashMatch(XPathExpr $xpath, string $attribute, ?string $value) : XPathExpr {
return $xpath->addCondition(\sprintf('%1$s and (%1$s = %2$s or starts-with(%1$s, %3$s))', $attribute, Translator::getXpathLiteral($value), Translator::getXpathLiteral($value . '-')));
}