php-html-parser icon indicating copy to clipboard operation
php-html-parser copied to clipboard

[Proposal] Append sibling

Open DONSA opened this issue 9 years ago • 1 comments

It would be great if it was possible to append a sibling tag, like this:

$blocks = $dom->find('.test');

foreach ($blocks as $index => $block)
{
    $tag = new Tag('<a>This is a Tag</a>');
    $block->after(tag);
}

DONSA avatar Jul 21 '16 16:07 DONSA

Great idea, although I would have it be $block->appendAfter(tag) instead of $block->after(tag).

Christian7573 avatar Jul 21 '16 17:07 Christian7573