PHP 클래스 QueryPath\CSS\Parser

In CSS, a selector is used to identify which element or elements in a DOM are being selected for the application of a particular style. Effectively, selectors function as a query language for a structured document -- almost always HTML or XML. This class provides an event-based parser for CSS selectors. It can be used, for example, as a basis for writing a DOM query engine based on CSS.
파일 보기 프로젝트 열기: microweber/microweber 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$DEBUG
$buffer
$handler
$scanner
$strict

공개 메소드들

메소드 설명
__construct ( $string, QueryPath\CSS\EventHandler $handler ) Construct a new CSS parser object. This will attempt to parse the string as a CSS selector. As it parses, it will send events to the EventHandler implementation.
parse ( ) Parse the selector.

비공개 메소드들

메소드 설명
allElements ( ) Check for all elements designators. Due to the new CSS 3 namespace support, this is slightly more complicated, now, as it handles the *|name and *|* cases as well as *.
attribute ( ) Handler an attribute.
combinator ( ) Handle one of the five combinators: '>', '+', ' ', '~', and ','.
consumeWhitespace ( ) Consume whitespace and return a count of the number of whitespace consumed.
elementClass ( ) Handles CSS class selectors.
elementID ( ) Handles CSS ID selectors.
elementName ( ) Handle element names.
isCombinator ( $tok ) Check if the token is a combinator.
pseudoClass ( $restricted = false ) Handle a pseudo-class and pseudo-element.
pseudoClassValue ( ) : string Get the value of a pseudo-classes.
selector ( ) Handle an entire CSS selector.
simpleSelectors ( ) Handle a simple selector.
throwError ( $expected, $got ) Utility for throwing a consistantly-formatted parse error.

메소드 상세

__construct() 공개 메소드

Construct a new CSS parser object. This will attempt to parse the string as a CSS selector. As it parses, it will send events to the EventHandler implementation.
public __construct ( $string, QueryPath\CSS\EventHandler $handler )
$handler QueryPath\CSS\EventHandler

parse() 공개 메소드

This begins an event-based parsing process that will fire events as the selector is handled. A EventHandler implementation will be responsible for handling the events.
public parse ( )

프로퍼티 상세

$DEBUG 보호되어 있는 프로퍼티

protected $DEBUG

$buffer 보호되어 있는 프로퍼티

protected $buffer

$handler 보호되어 있는 프로퍼티

protected $handler

$scanner 보호되어 있는 프로퍼티

protected $scanner

$strict 보호되어 있는 프로퍼티

protected $strict