|
|
@@ -14,14 +14,6 @@ use Twig\Environment;
|
|
|
class DocXEncoder implements EncoderInterface
|
|
|
{
|
|
|
|
|
|
- private Environment $twig;
|
|
|
-
|
|
|
- public function __construct(Environment $twig)
|
|
|
- {
|
|
|
- $this->twig = $twig;
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
public function support(string $format): bool
|
|
|
{
|
|
|
return $format === ExportFormatEnum::DOCX()->getValue();
|
|
|
@@ -38,7 +30,7 @@ class DocXEncoder implements EncoderInterface
|
|
|
public function encode(string $html, array $options = []): string
|
|
|
{
|
|
|
$docx = new CreateDocx();
|
|
|
- $docx->embedHTML('<html><head></head></heade><body><p>Coucou</p></body></html>');
|
|
|
+ $docx->embedHTML($html);
|
|
|
$tempFile = tempnam(sys_get_temp_dir(), 'docx');
|
|
|
$docx->createDocx($tempFile);
|
|
|
$content = file_get_contents($tempFile);
|