-
Notifications
You must be signed in to change notification settings - Fork 701
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature #2022 Inject Twig by default instead of EngineInterface for S…
…ymfony >= 4.3 (sarcher) This PR was squashed before being merged into the 2.6-dev branch (closes #2022). Discussion ---------- Inject Twig by default instead of EngineInterface for Symfony >= 4.3 This addresses #2020 by: * Changing the default `services.templating` value from `templating` to `twig` if Symfony is >= 4.3 (it can still be overridden in `symfony/templating` is present * Removing the type hint from `TwigExceptionController` and `ViewHandler` to allow either `Twig\Environment` or `EngineInterface` to be passed * Borrowing the bridge code from TwigBundle to handle the new Twig template lookup via try/catch Seems to work in 4.2 and 4.3, I tried it in both; we'll see what the CI says. Not sure this is the best approach but I needed something working and so far so good. Please let me know if this needs to look different. I considered just having two separate classes for with/without the templating component, but this is far less code to maintain. Commits ------- e6f8eb5 Inject Twig by default instead of EngineInterface for Symfony >= 4.3
- Loading branch information
Showing
4 changed files
with
64 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters