Skip to content

Use the core {do} tag instead of {php} in templates - #1304

Merged
radimvaculik merged 1 commit into
contributte:masterfrom
dg:fix/do-instead-of-php
Aug 14, 2026
Merged

Use the core {do} tag instead of {php} in templates#1304
radimvaculik merged 1 commit into
contributte:masterfrom
dg:fix/do-instead-of-php

Conversation

@dg

@dg dg commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

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.

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.
Copilot AI lite review requested due to automatic review settings August 9, 2026 17:55
@codecov

codecov Bot commented Aug 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.12%. Comparing base (ab5506d) to head (21a3115).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

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 ...} in datagrid.latte.
  • Replaced {php ...} with {do ...} in datagrid_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.

Comment thread src/templates/datagrid_tree.latte
Comment thread src/templates/datagrid.latte
@radimvaculik
radimvaculik merged commit 08ed8b4 into contributte:master Aug 14, 2026
10 checks passed
@radimvaculik

Copy link
Copy Markdown
Member

Merged, thank you!

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.

3 participants