-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Couldn't add child. #152
Comments
You have to store an each element to a variable: <?php
use DiDom\Document;
require './vendor/autoload.php';
$doc = new Document();
$html = $doc->createElement('html');
$body = $doc->createElement('body');
$h1 = $body->appendChild($doc->createElement('h1', 'hi'));
$html->appendChild($body);
echo $html->html(); |
Yes, with this way the problem will be solved but why? is there another way? |
I don't know why it exactly happens but when you call $Html->appendChild(
$Doc->createElement('body')->appendChild(
$Doc->createElement('h1', 'hi')
)
); it's try to add
I don't know. I spent a little time to figure out what's wrong but I couldn't. |
Okey, thanks. I guess there is no solution. |
I think this is an important issue and it should stay open. |
Hi, I want create a web-page with DiDOM but I have some problems.
Error:
The text was updated successfully, but these errors were encountered: