Method |
Description |
|
__construct ( $DOMNode, $namespaces = [] ) |
from different documents! DOMTemplateNodes _must_ come from DOMDocument kept privately inside DOMTemplate |
|
__toString ( ) |
* output the source code (cast the object to a string, i.e. echo $template;)
-------------------------------------------------------------------------------------------------------------- |
|
addClass ( $query, $new_class ) |
* addClass : add a className to an element, appending it to existing classes if they exist
-------------------------------------------------------------------------------------------------------------- |
|
html_entity_decode ( $html ) |
* html_entity_decode : convert HTML entities back to UTF-8
-------------------------------------------------------------------------------------------------------------- |
|
query ( $query ) |
DOMNodeList and therefore can't create APIs that affect all the nodes returned by an XPath query |
|
remove ( $query ) |
* remove : remove all the elements / attributes that match an xpath query
-------------------------------------------------------------------------------------------------------------- |
|
repeat ( $query ) |
*
$item = $DOMTemplate->repeat ('.list-item');
foreach ($data as $value) $item->setValue ('.', $value)->next (); |
|
set ( $queries, $asHTML = false ) |
* set : change multiple nodes in a simple fashion
-------------------------------------------------------------------------------------------------------------- |
|
setValue ( $query, $value, $asHTML = false ) |
* setValue : set the text on the results of a single xpath query
-------------------------------------------------------------------------------------------------------------- |
|
shorthand2xpath ( $query, $use_relative = true ) |
* an index-number can be provided after the element name, e.g. 'li[1]' |
|
toXML ( $text ) |
* toXML : convert string input to safe XML for inporting into DOM
-------------------------------------------------------------------------------------------------------------- |
|