[WIP] v11: fix DI

This commit is contained in:
Sascha Bruemmer 2022-08-19 11:13:06 +02:00
parent 254a970468
commit 8fa50c3089
2 changed files with 9 additions and 3 deletions

View file

@ -3,7 +3,6 @@ namespace Saccas\Mjml\View;
use Saccas\Mjml\Domain\Renderer\RendererInterface; use Saccas\Mjml\Domain\Renderer\RendererInterface;
use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Object\ObjectManager;
use TYPO3\CMS\Fluid\View\StandaloneView; use TYPO3\CMS\Fluid\View\StandaloneView;
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer; use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
@ -17,8 +16,7 @@ class MjmlBasedView extends StandaloneView
$this->renderer = $renderer; $this->renderer = $renderer;
if ($this->renderer === null) { if ($this->renderer === null) {
$objectManager = GeneralUtility::makeInstance(ObjectManager::class); $this->renderer = GeneralUtility::makeInstance(RendererInterface::class);
$this->renderer = $objectManager->get(RendererInterface::class);
} }
} }

8
Configuration/Services.yaml Executable file
View file

@ -0,0 +1,8 @@
services:
_defaults:
autowire: true
autoconfigure: true
public: false
Saccas\Mjml\:
resource: '../Classes/*'