PHP Class FluentDOM\DocumentFragment

Be aware that a fragment is empty after it was appended.
Inheritance: extends DOMDocumentFragment, implements Countable, implements IteratorAggregate, implements FluentDOM\Node\ParentNode, use trait FluentDOM\Node\ParentNode\Properties, use trait Node\QuerySelector\Implementation, use trait FluentDOM\Node\Xpath
Afficher le fichier Open project: fluentdom/fluentdom

Méthodes publiques

Méthode Description
__toString ( ) : string Casting the fragment to string will return the text content of all nodes
appendElement ( string $name, string $content = '', array $attributes = NULL ) : Element Append an child element
appendXml ( string $data, null | array | Traversable | DOMElement $namespaces = NULL ) : boolean Append an xml to the fragment, it can use namespace prefixes defined on the fragment object.
count ( ) : integer
getIterator ( ) : Iterator
namespaces ( null | array | Traversable | DOMElement $namespaces = NULL ) : array Get/Set the namespace definition used for the fragment strings.
registerNamespace ( $prefix, $namespace ) Register a namespace prefix to use it in appendXml()
saveXmlFragment ( ) : string Save as XML string

Method Details

__toString() public méthode

Casting the fragment to string will return the text content of all nodes
public __toString ( ) : string
Résultat string

appendElement() public méthode

Append an child element
public appendElement ( string $name, string $content = '', array $attributes = NULL ) : Element
$name string
$content string
$attributes array
Résultat Element

appendXml() public méthode

Append an xml to the fragment, it can use namespace prefixes defined on the fragment object.
public appendXml ( string $data, null | array | Traversable | DOMElement $namespaces = NULL ) : boolean
$data string
$namespaces null | array | Traversable | DOMElement
Résultat boolean

count() public méthode

public count ( ) : integer
Résultat integer

getIterator() public méthode

public getIterator ( ) : Iterator
Résultat Iterator

namespaces() public méthode

You can use an array(prefix => $namespace, ...) or an element node to set the namespaces. If the list is empty the document, the namespaces from the document object will be used.
public namespaces ( null | array | Traversable | DOMElement $namespaces = NULL ) : array
$namespaces null | array | Traversable | DOMElement
Résultat array

registerNamespace() public méthode

Register a namespace prefix to use it in appendXml()
public registerNamespace ( $prefix, $namespace )
$prefix
$namespace

saveXmlFragment() public méthode

Save as XML string
public saveXmlFragment ( ) : string
Résultat string