Свойство | Тип | Описание | |
---|---|---|---|
$_nodes | DOMNode[] | ||
$_parent | |||
$_useDocumentContext | boolean | Use document context for expression (not selected nodes). |
Метод | Описание | |
---|---|---|
__construct ( mixed $source = NULL, null | string $contentType = 'text/xml' ) | ||
__get ( string $name ) : mixed | Virtual properties, read property | |
__isset ( string $name ) : boolean | Virtual properties, validate existence | |
__set ( string $name, mixed $value ) | Block changing the readonly dynamic property | |
__toString ( ) : string | Return the output of the internal dom document | |
__unset ( string $name ) | Throws an exception if somebody tries to unset one of the dynamic properties | |
count ( ) : integer | Countable interface | |
each ( callable $function, callable | boolean | null $elementsFilter = NULL ) | Execute a function within the context of every matched element. | |
end ( ) : |
Return the parent FluentDOM\Nodes object. | |
find ( mixed $selector, integer $options ) : |
Searches for descendant elements that match the specified expression. | |
formatOutput ( string $contentType = NULL ) : |
Formats the current document, resets internal node array and other properties. | |
getDocument ( ) : DOMDocument | |
Get the associated DOM, create one if here isn't one yet. | |
getIterator ( ) : |
IteratorAggregate interface | |
getLoadingOptions ( null | string $contentType = NULL ) : array | mixed | Return the options from the original loading action, but only if the content type equals the loaded content type. | |
getSelectorCallback ( null | callable | string | array | DOMNode | Traversable $selector ) : callable | null | Returns a callback that can be used to validate if an node matches the selector. | |
index ( null | string | DOMNode | Traversable $selector = NULL ) : integer | Search for a given element from among the matched elements. | |
item ( integer $position ) : DOMElement | DOMNode | The item() method is used to access elements in the node list, like in a DOMNodeList. | |
load ( mixed $source, string $contentType = 'text/xml', array | Traversable | |
Load a $source. The type of the source depends on the loaders. If no explicit loaders are set it will use a set of default loaders for xml/html and json. | |
loaders ( fluentdom\Loadable | array | Traversable $loaders = NULL ) : fluentdom\Loadable | Set the loaders list. | |
offsetExists ( integer $offset ) : boolean | Check if index exists in internal array | |
offsetGet ( integer $offset ) : DOMElement | DOMNode | null | Get element from internal array | |
offsetSet ( integer $offset, mixed $value ) | If somebody tries to modify the internal array throw an exception. | |
offsetUnset ( integer $offset ) | If somebody tries to remove an element from the internal array throw an exception. | |
prepareSelector ( string $selector, integer $contextMode ) : string | Use callback to convert selector if it is set. | |
push ( DOMNode | Traversable | array | null $elements, boolean $ignoreTextNodes = FALSE ) | Push new element(s) an the internal element list | |
registerNamespace ( string $prefix, string $namespace ) | Register a namespace for selectors/expressions | |
serializerFactories ( |
||
spawn ( array | Traversable | DOMNode | |
Create a new instance of the same class with $this as the parent. This is used for the chaining. | |
toArray ( ) : DOMNode[] | Retrieve the matched DOM nodes in an array. | |
toString ( ) : string | Return the output of the internal dom document | |
unique ( array $array ) : array | Sorts an array of DOM nodes based on document position, in place, with the duplicates removed. | |
xpath ( string $expression = NULL, DOMNode $contextNode = NULL ) : |
Метод | Описание | |
---|---|---|
fetch ( string $expression, null | string | callable | DOMNode | array | Traversable $filter = NULL, null | string | callable | DOMNode | array | Traversable $stopAt = NULL, integer $options ) : |
Fetch spawns and fills a Nodes instance. | |
matches ( string $selector, DOMNode $context = NULL ) : boolean | Test that selector matches context and return true/false |
Метод | Описание | |
---|---|---|
applyNamespaces ( ) | apply stored namespaces to attached document or xpath object | |
getXpath ( ) : |
||
prepareFindContext ( mixed $selector, integer $options ) : array | ||
prepareSelectorAsFilter ( $selector, $contextMode ) | ||
prepareSource ( mixed $source, string $contentType, array | Traversable | |
||
setContentType ( string $value ) | Setter for Nodes::_contentType property |
public __toString ( ) : string | ||
Результат | string |
public end ( ) : |
||
Результат |
protected fetch ( string $expression, null | string | callable | DOMNode | array | Traversable $filter = NULL, null | string | callable | DOMNode | array | Traversable $stopAt = NULL, integer $options ) : |
||
$expression | string | Xpath expression |
$filter | null | string | callable | DOMNode | array | Traversable | |
$stopAt | null | string | callable | DOMNode | array | Traversable | |
$options | integer | |
Результат |
public formatOutput ( string $contentType = NULL ) : |
||
$contentType | string | |
Результат |
public getDocument ( ) : DOMDocument | |
||
Результат | DOMDocument | |
public getIterator ( ) : |
||
Результат |
public getSelectorCallback ( null | callable | string | array | DOMNode | Traversable $selector ) : callable | null | ||
$selector | null | callable | string | array | DOMNode | Traversable | |
Результат | callable | null |
public index ( null | string | DOMNode | Traversable $selector = NULL ) : integer | ||
$selector | null | string | DOMNode | Traversable | |
Результат | integer |
public load ( mixed $source, string $contentType = 'text/xml', array | Traversable | |
||
$source | mixed | |
$contentType | string | optional, default value 'text/xml' |
$options | array | Traversable | |
public loaders ( fluentdom\Loadable | array | Traversable $loaders = NULL ) : fluentdom\Loadable | ||
$loaders | fluentdom\Loadable | array | Traversable | |
Результат | fluentdom\Loadable |
public offsetExists ( integer $offset ) : boolean | ||
$offset | integer | |
Результат | boolean |
public offsetUnset ( integer $offset ) | ||
$offset | integer |
public push ( DOMNode | Traversable | array | null $elements, boolean $ignoreTextNodes = FALSE ) | ||
$elements | DOMNode | Traversable | array | null | |
$ignoreTextNodes | boolean | ignore text nodes |
public registerNamespace ( string $prefix, string $namespace ) | ||
$prefix | string | |
$namespace | string |
public serializerFactories ( |
||
$factories | ||
Результат |
public spawn ( array | Traversable | DOMNode | |
||
$elements | array | Traversable | DOMNode | |
|
Результат |
public toArray ( ) : DOMNode[] | ||
Результат | DOMNode[] |
protected bool $_useDocumentContext | ||
Результат | boolean |