PHP Class DiDom\Query

Afficher le fichier Open project: imangazaliev/didom Class Usage Examples

Protected Properties

Свойство Type Description
$compiled array

Méthodes publiques

Méthode Description
buildXpath ( array $segments, string $prefix = '//' ) : string
compile ( string $expression, string $type = self::TYPE_CSS ) : string Converts a CSS selector into an XPath expression.
cssToXpath ( string $selector, string $prefix = '//' ) : string Converts a CSS selector into an XPath expression.
getCompiled ( ) : array
getSegments ( string $selector ) : array Splits the CSS selector into parts (tag name, ID, classes, attributes, pseudo-class).
setCompiled ( array $compiled )

Méthodes protégées

Méthode Description
convertAttribute ( string $name, string $value ) : string
convertContains ( string $string, boolean $caseSensetive = false ) : string
convertNthExpression ( string $expression ) : string Converts nth-expression into an XPath expression.
convertProperty ( string $name, array $args = [] ) : string
convertPseudo ( string $pseudo, string $parameters = [], string &$tagName ) : string Converts a CSS pseudo-class into an XPath expression.
parseProperty ( string $property ) : array

Method Details

buildXpath() public static méthode

public static buildXpath ( array $segments, string $prefix = '//' ) : string
$segments array
$prefix string Specifies the nesting of nodes
Résultat string XPath expression

compile() public static méthode

Converts a CSS selector into an XPath expression.
public static compile ( string $expression, string $type = self::TYPE_CSS ) : string
$expression string XPath expression or CSS selector
$type string The type of the expression
Résultat string XPath expression

convertAttribute() protected static méthode

protected static convertAttribute ( string $name, string $value ) : string
$name string The attribute name
$value string The attribute value
Résultat string

convertContains() protected static méthode

protected static convertContains ( string $string, boolean $caseSensetive = false ) : string
$string string
$caseSensetive boolean
Résultat string

convertNthExpression() protected static méthode

Converts nth-expression into an XPath expression.
protected static convertNthExpression ( string $expression ) : string
$expression string nth-expression
Résultat string

convertProperty() protected static méthode

protected static convertProperty ( string $name, array $args = [] ) : string
$name string
$args array
Résultat string

convertPseudo() protected static méthode

Converts a CSS pseudo-class into an XPath expression.
protected static convertPseudo ( string $pseudo, string $parameters = [], string &$tagName ) : string
$pseudo string Pseudo-class
$parameters string
$tagName string
Résultat string

cssToXpath() public static méthode

Converts a CSS selector into an XPath expression.
public static cssToXpath ( string $selector, string $prefix = '//' ) : string
$selector string A CSS selector
$prefix string Specifies the nesting of nodes
Résultat string XPath expression

getCompiled() public static méthode

public static getCompiled ( ) : array
Résultat array

getSegments() public static méthode

Splits the CSS selector into parts (tag name, ID, classes, attributes, pseudo-class).
public static getSegments ( string $selector ) : array
$selector string CSS selector
Résultat array

parseProperty() protected static méthode

protected static parseProperty ( string $property ) : array
$property string
Résultat array

setCompiled() public static méthode

public static setCompiled ( array $compiled )
$compiled array

Property Details

$compiled protected_oe static_oe property

protected static array $compiled
Résultat array