-
Notifications
You must be signed in to change notification settings - Fork 20
Element AppendElement
Thomas Weinert edited this page Jul 12, 2018
·
5 revisions
FluentDOM\DOM\Element appendElement(
string $name [ , string $content = '' [ , array $attributes = NULL ]]
)
FluentDOM\DOM\Element appendElement(
string $name [ , array $attributes = NULL ]
)
A shortcut to create, configure an append an element node.
$document = new FluentDOM\DOM\Document();
$document->appendChild($document->createElement('div'));
$document->documentElement->appendElement(
'span', 'Hello World!', ['class' => 'message']
);
echo $document->saveXML();
<?xml version="1.0" encoding="UTF-8"?>
<div><span class="message">Hello World!</span></div>
- 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