Repository navigation
feat(config): add template.engine setting - #1973
Merged
Merged
Conversation
Add a setting that selects the engine used to render pages and emails. It defaults to Smarty, so installs keep rendering with Smarty unless they opt in to Twig, which is offered as experimental. Nothing reads the setting yet. TemplateEngine::configured() is the single place later changes will ask which engine is selected; it falls back to Smarty when the setting is missing or has an unknown value. The setting is listed with the other frontend options, and config.dist.php and .env.example are regenerated to include it. Assisted-by: Claude:claude-fable-5-2
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active issues are identified in the reviewed changes, which cover the new template-engine configuration, fallback behavior, generated settings, and associated tests.
No open issues 🎉
What changed in this PR
Adds a configurable template-engine selector with Smarty as the default and Twig as an experimental option, while preserving Smarty fallback behavior.
Changes:
- Adds the
TemplateEngineenum and centralized configuration lookup. - Registers
template.enginewith Smarty and Twig choices in the Frontend settings. - Updates generated configuration examples and adds tests for defaults, valid values, and fallback behavior.
| File | Description |
|---|---|
| tests/src/Common/Templating/TemplateEngineTest.php | Tests template-engine defaults, supported values, available choices, and fallback behavior. |
| src/Common/Templating/TemplateEngine.php | Defines supported template engines and resolves the configured engine with Smarty fallback behavior. |
| lib/Config/ConfigKeysMeta.php | Places the template-engine setting in the Frontend configuration group. |
| lib/Config/ConfigKeys.php | Registers the template.engine setting and its allowed values. |
| config/config.dist.php | Adds the generated default template-engine configuration and documentation. |
| .env.example | Adds the generated environment-variable example for selecting the template engine. |
Review effort: Lite
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a setting that selects the engine used to render pages and emails. It defaults to Smarty, so installs keep rendering with Smarty unless they opt in to Twig, which is offered as experimental.
Nothing reads the setting yet. TemplateEngine::configured() is the single place later changes will ask which engine is selected; it falls back to Smarty when the setting is missing or has an unknown value.
The setting is listed with the other frontend options, and config.dist.php and .env.example are regenerated to include it.
Assisted-by: Claude:claude-fable-5-2