diff --git a/CHANGELOG.md b/CHANGELOG.md index c5b2d0e..3dbc3d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [3.1.5] - 2019-08-21 + +### Fixed + + - Use twig directly instead of templating component to restore Contao 4.8 + ## [3.1.4] - 2019-02-13 ### Fixed diff --git a/composer.json b/composer.json index e21def3..9fcd52c 100644 --- a/composer.json +++ b/composer.json @@ -36,8 +36,9 @@ "symfony/event-dispatcher": "~3.3 || ~4.0", "symfony/filesystem": "~3.3 || ~4.0", "symfony/http-kernel": "~3.3 || ~4.0", - "symfony/templating": "~3.3 || ~4.0", - "symfony/translation": "~3.3 || ~4.0" + "symfony/twig-bundle": "~3.3 || ~4.0", + "symfony/translation": "~3.3 || ~4.0", + "twig/twig": "^1.3.35 || ^2.0", }, "require-dev": { "contao/manager-plugin": "^2.1", diff --git a/src/Backend/Action/AboutAction.php b/src/Backend/Action/AboutAction.php index 8e0e178..c30f2f8 100644 --- a/src/Backend/Action/AboutAction.php +++ b/src/Backend/Action/AboutAction.php @@ -5,15 +5,15 @@ * * @package contao-leaflet-maps * @author David Molineus - * @copyright 2014-2017 netzmacht David Molineus. All rights reserved. + * @copyright 2014-2019 netzmacht David Molineus. All rights reserved. * @license LGPL-3.0 https://github.com/netzmacht/contao-leaflet-maps/blob/master/LICENSE * @filesource */ namespace Netzmacht\Contao\Leaflet\Backend\Action; -use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface as Engine; use Symfony\Component\HttpFoundation\Response; +use Twig\Environment; /** * Credits backend module. @@ -23,11 +23,11 @@ use Symfony\Component\HttpFoundation\Response; final class AboutAction { /** - * Templating engine. + * Twig environment. * - * @var Engine + * @var Environment */ - private $engine; + private $twig; /** * Project directory. @@ -39,12 +39,12 @@ final class AboutAction /** * AboutAction constructor. * - * @param Engine $engine Templating engine. - * @param string $projectDir Project directory. + * @param Environment $twig Twig environment. + * @param string $projectDir Project directory. */ - public function __construct(Engine $engine, string $projectDir) + public function __construct(Environment $twig, string $projectDir) { - $this->engine = $engine; + $this->twig = $twig; $this->projectDir = $projectDir; } @@ -62,7 +62,9 @@ final class AboutAction [$data['version'], $data['dependencies']] = $this->extractFromComposer(); - return $this->engine->renderResponse('@NetzmachtContaoLeaflet/backend/about.html.twig', $data); + return new Response( + $this->twig->render('@NetzmachtContaoLeaflet/backend/about.html.twig', $data) + ); } /** diff --git a/src/Bundle/Resources/config/services.yml b/src/Bundle/Resources/config/services.yml index a129799..5052736 100644 --- a/src/Bundle/Resources/config/services.yml +++ b/src/Bundle/Resources/config/services.yml @@ -136,5 +136,5 @@ services: Netzmacht\Contao\Leaflet\Backend\Action\AboutAction: public: true arguments: - - '@templating' + - '@twig' - '%kernel.project_dir%'