-
Notifications
You must be signed in to change notification settings - Fork 20
Appendable
Thomas Weinert edited this page Jul 25, 2014
·
3 revisions
An interface that can be used to define a class as appendable to an Element node.
class Example implements \FluentDOM\Appendable {
public function appendTo(\FluentDOM\Element $parent) {
$parent->appendChild(
$parent->ownerDocument->createTextNode('Hello World!')
);
}
}
$dom = new FluentDOM\Document();
$dom->appendChild($dom->createElement('xml'));
$dom->documentElement->append(new Example());
echo $dom->saveXml();
```
### Output
```xml
<?xml version="1.0" encoding="UTF-8"?>
<xml>Hello World!</xml>
```
See also:
[[FluentDOM\Element::append()|Element-Append]]- Home
- Getting Started
- Tasks
- Plugins
- Functions
- Lists
- Creator (5.1)
- CSS Selectors
- Convertors
- Loaders
- Serializers (5.1)
- Transformers (5.1)
- Extended DOM
- XMLReader (6.1)
- XMLWriter (6.1)
- Interfaces