mirror of
https://github.com/saccas/mjml-typo3.git
synced 2024-11-15 07:16:09 +01:00
Daniel Siepmann
c45dee45b0
Use one functional test to ensure everything works, no unit tests with heavy mocking. Update mjml to fix security issues and allow new options. Provide GitHub Actions. This is a public extension with free minutes which should ensure that existing setup still works.
28 lines
664 B
PHP
28 lines
664 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Saccas\Mjml\View;
|
|
|
|
use Saccas\Mjml\Domain\Renderer\RendererInterface;
|
|
use TYPO3\CMS\Fluid\View\StandaloneView;
|
|
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
|
|
|
|
class MjmlBasedView extends StandaloneView
|
|
{
|
|
protected RendererInterface $renderer;
|
|
|
|
public function __construct(
|
|
ContentObjectRenderer $contentObject,
|
|
RendererInterface $renderer
|
|
) {
|
|
parent::__construct($contentObject);
|
|
|
|
$this->renderer = $renderer;
|
|
}
|
|
|
|
public function render($actionName = null): string
|
|
{
|
|
return $this->renderer->getHtmlFromMjml(parent::render($actionName));
|
|
}
|
|
}
|