Use the core {do} tag instead of {php} in templates - #1304
Merged
Conversation
All six occurrences are plain expression statements, which is exactly
what {do} does. In Latte 3 the {php} tag lives in the opt-in
RawPhpExtension, which this package neither requires nor registers, so
the templates now work without it.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1304 +/- ##
=======================================
Coverage 49.12% 49.12%
=======================================
Files 63 63
Lines 2974 2974
=======================================
Hits 1461 1461
Misses 1513 1513 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Latte templates to use the core {do} tag in places where {php} was previously used, improving compatibility with Latte 3 where {php} requires the opt-in RawPhpExtension.
Changes:
- Replaced
{php ...}with{do ...}indatagrid.latte. - Replaced
{php ...}with{do ...}indatagrid_tree.latte.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/templates/datagrid.latte | Replaces {php} statements with {do} to avoid requiring RawPhpExtension under Latte 3. |
| src/templates/datagrid_tree.latte | Same {php} → {do} replacement for tree rendering templates to keep them working under Latte 3 defaults. |
Suppressed comments (1)
src/templates/datagrid_tree.latte:101
- Use {var ...} for variable assignment. {do} is better reserved for side-effect expressions; using it for assignments is less idiomatic and inconsistent with other templates in this repo (which use {var $x = ...}).
{do $column = $row->applyColumnCallback($key, clone $column)}
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
radimvaculik
approved these changes
Aug 14, 2026
Member
|
Merged, thank you! |
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.
All six occurrences are plain expression statements, which is exactly what {do} does. In Latte 3 the {php} tag lives in the opt-in RawPhpExtension, which this package neither requires nor registers, so the templates now work without it.