mirror of
https://github.com/netzmacht/contao-leaflet-maps.git
synced 2025-11-28 11:04:08 +01:00
Use twig instead of templating engine to render about page
This restores compatibility with Contao 4.8 without changing default configuration of the symfony framework bundle.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -5,15 +5,15 @@
|
||||
*
|
||||
* @package contao-leaflet-maps
|
||||
* @author David Molineus <david.molineus@netzmacht.de>
|
||||
* @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)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -136,5 +136,5 @@ services:
|
||||
Netzmacht\Contao\Leaflet\Backend\Action\AboutAction:
|
||||
public: true
|
||||
arguments:
|
||||
- '@templating'
|
||||
- '@twig'
|
||||
- '%kernel.project_dir%'
|
||||
|
||||
Reference in New Issue
Block a user