Repository navigation
refactor(templating): add TemplateRenderer interface - #1976
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
A critical interface-design issue remains because its typed method contracts conflict with the case-insensitive, legacy SmartyPage API, preventing intended implementations from satisfying the interface.
1 open issue
What changed in this PR
Adds a TemplateRenderer interface to provide an engine-neutral contract for future Smarty and Twig integrations across pages, controls, and emails.
Changes:
- Defines variable assignment and template rendering methods.
- Adds localized, template-directory, and control-template operations.
- Exposes validator access and validation status.
| File | Description |
|---|---|
| src/Common/Templating/TemplateRenderer.php | Introduces the shared template-rendering interface for future Smarty and Twig implementations. |
Review effort: Lite
JohnVillalovos
force-pushed
the
jlvillal/twig
branch
from
November 19, 2026 01:22
815185f to
1708f2d
Compare
JohnVillalovos
force-pushed
the
jlvillal/twig
branch
2 times, most recently
from
November 19, 2026 01:35
5c22f86 to
69f9a0d
Compare
Add the interface that the Smarty and Twig renderers will both implement, so pages, controls and emails can render through either engine without knowing which one is in use. The interface follows what SmartyPage offers today (assigning variables, fetching and displaying templates, localized and control templates, validators) rather than a minimal rendering contract, so call sites can move to it with few changes. This is groundwork only. Nothing implements the interface yet, and some callers use Smarty-specific methods it does not cover, such as the reservation formatting helpers and the resource image responses. Those still have to be migrated. Assisted-by: Claude:claude-fable-5-2
JohnVillalovos
force-pushed
the
jlvillal/twig
branch
from
November 19, 2026 01:36
69f9a0d to
7f5ed5f
Compare
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Human review is needed because the foundational interface lacks renderer implementations and contract tests to confirm that the planned Smarty and Twig adapters honor its cross-engine state, localization, control-template, and validation semantics.
No open issues 🎉
1 resolved since last review
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 the interface that the Smarty and Twig renderers will both implement, so pages, controls and emails can render through either engine without knowing which one is in use.
The interface follows what SmartyPage offers today (assigning variables, fetching and displaying templates, localized and control templates, validators) rather than a minimal rendering contract, so call sites can move to it with few changes.
This is groundwork only. Nothing implements the interface yet, and some callers use Smarty-specific methods it does not cover, such as the reservation formatting helpers and the resource image responses. Those still have to be migrated.
Assisted-by: Claude:claude-fable-5-2