W3cubDocs

/Symfony 4.1

FunctionExtension

class FunctionExtension extends AbstractExtension

XPath expression translator function extension.

This component is a port of the Python cssselect library, which is copyright Ian Bicking, see https://github.com/SimonSapin/cssselect.

Methods

callable[] getNodeTranslators()

Returns node translators.

from AbstractExtension
callable[] getCombinationTranslators()

Returns combination translators.

from AbstractExtension
callable[] getFunctionTranslators()

Returns function translators.

callable[] getPseudoClassTranslators()

Returns pseudo-class translators.

from AbstractExtension
callable[] getAttributeMatchingTranslators()

Returns attribute operation translators.

from AbstractExtension
XPathExpr translateNthChild(XPathExpr $xpath, FunctionNode $function, bool $last = false, bool $addNameTest = true)
XPathExpr translateNthLastChild(XPathExpr $xpath, FunctionNode $function)
XPathExpr translateNthOfType(XPathExpr $xpath, FunctionNode $function)
XPathExpr translateNthLastOfType(XPathExpr $xpath, FunctionNode $function)
XPathExpr translateContains(XPathExpr $xpath, FunctionNode $function)
XPathExpr translateLang(XPathExpr $xpath, FunctionNode $function)
string getName()

Returns extension name.

Details

callable[] getNodeTranslators()

Returns node translators.

These callables will receive the node as first argument and the translator as second argument.

Return Value

callable[]

callable[] getCombinationTranslators()

Returns combination translators.

Return Value

callable[]

callable[] getFunctionTranslators()

Returns function translators.

Return Value

callable[]

callable[] getPseudoClassTranslators()

Returns pseudo-class translators.

Return Value

callable[]

callable[] getAttributeMatchingTranslators()

Returns attribute operation translators.

Return Value

callable[]

XPathExpr translateNthChild(XPathExpr $xpath, FunctionNode $function, bool $last = false, bool $addNameTest = true)

Parameters

XPathExpr $xpath
FunctionNode $function
bool $last
bool $addNameTest

Return Value

XPathExpr

Exceptions

ExpressionErrorException

XPathExpr translateNthLastChild(XPathExpr $xpath, FunctionNode $function)

Parameters

XPathExpr $xpath
FunctionNode $function

Return Value

XPathExpr

XPathExpr translateNthOfType(XPathExpr $xpath, FunctionNode $function)

Parameters

XPathExpr $xpath
FunctionNode $function

Return Value

XPathExpr

XPathExpr translateNthLastOfType(XPathExpr $xpath, FunctionNode $function)

Parameters

XPathExpr $xpath
FunctionNode $function

Return Value

XPathExpr

Exceptions

ExpressionErrorException

XPathExpr translateContains(XPathExpr $xpath, FunctionNode $function)

Parameters

XPathExpr $xpath
FunctionNode $function

Return Value

XPathExpr

Exceptions

ExpressionErrorException

XPathExpr translateLang(XPathExpr $xpath, FunctionNode $function)

Parameters

XPathExpr $xpath
FunctionNode $function

Return Value

XPathExpr

Exceptions

ExpressionErrorException

string getName()

Returns extension name.

Return Value

string

© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/CssSelector/XPath/Extension/FunctionExtension.html