Skip to content

feat(config): add template.engine setting - #1973

Merged
JohnVillalovos merged 1 commit into
mainfrom
jlvillal/twig
Nov 19, 2026
Merged

JohnVillalovos merged 1 commit into
mainfrom
jlvillal/twig

Conversation

@JohnVillalovos

Copy link
Copy Markdown
Collaborator

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

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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 TemplateEngine enum and centralized configuration lookup.
  • Registers template.engine with 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

@JohnVillalovos
JohnVillalovos merged commit 4aebf61 into main Nov 19, 2026
16 checks passed
@JohnVillalovos
JohnVillalovos deleted the jlvillal/twig branch November 19, 2026 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants