-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
Hi,
Currently in the DocumentExporter, there is a fixed definition of the tags where to wrap the exported html in.
DH\Adf\Exporter\Html\Block\DocumentExporter
It would be nice to make it possible to overwrite the wrapping tag, something like;
$output = (new DocumentExporter($doc))
->wrapTags('<div class="container"><div class="row">', '</div></div>')
->export();
The code to extend the DocumentExporter with
public function wrapTags(?string $opening = null, ?string $closing = null): self
{
if (
(null !== $opening && null === $closing)
|| (null === $opening && null !== $closing)
) {
throw new RuntimeException('Passing both opening and closing tag.');
}
if (null === $opening && null === $closing) {
$this->tags = [];
return $this;
}
$this->tags = [$opening, $closing];
return $this;
}
With this it is possible to set it to nothing, to not wrap it in tags.
Regards, Bert
Metadata
Metadata
Assignees
Labels
No labels