PHP Class QueryPath, microweber

Show file Open project: microweber/microweber Class Usage Examples

Public Methods

Method Description
enable ( mixed $extensionNames ) Enable one or more extensions.
enabledExtensions ( ) Get a list of all of the enabled extensions.
encodeDataURL ( mixed $data, string $mime = 'application/octet-stream', resource $context = null ) A static function for transforming data into a Data URL.
with ( $document = null, $selector = null, $options = [] )
withHTML ( $source = null, $selector = null, $options = [] )
withXML ( $source = null, $selector = null, $options = [] )

Method Details

enable() public static method

Extensions provide additional features to QueryPath. To enable and extension, you can use this method. In this example, we enable the QPTPL extension:
public static enable ( mixed $extensionNames )
$extensionNames mixed The name of an extension or an array of extension names. QueryPath assumes that these are extension class names, and attempts to register these as QueryPath extensions.

enabledExtensions() public static method

This example dumps a list of extensions to standard output:
See also: QueryPath::ExtensionRegistry
public static enabledExtensions ( )

encodeDataURL() public static method

This can be used to create Data URLs for injection into CSS, JavaScript, or other non-XML/HTML content. If you are working with QP objects, you may want to use dataURL() instead.
public static encodeDataURL ( mixed $data, string $mime = 'application/octet-stream', resource $context = null )
$data mixed The contents to inject as the data. The value can be any one of the following: - A URL: If this is given, then the subsystem will read the content from that URL. THIS MUST BE A FULL URL, not a relative path. - A string of data: If this is given, then the subsystem will encode the string. - A stream or file handle: If this is given, the stream's contents will be encoded and inserted as data. (Note that we make the assumption here that you would never want to set data to be a URL. If this is an incorrect assumption, file a bug.)
$mime string The MIME type of the document.
$context resource A valid context. Use this only if you need to pass a stream context. This is only necessary if $data is a URL. (See {@link stream_context_create()}).

with() public static method

public static with ( $document = null, $selector = null, $options = [] )

withHTML() public static method

public static withHTML ( $source = null, $selector = null, $options = [] )

withXML() public static method

public static withXML ( $source = null, $selector = null, $options = [] )