Commit Graph

1677 Commits

Author SHA1 Message Date
Nicolas Grekas 9e1e2e2cea Allow skipping the directory check when adding paths to FilesystemLoader 2026-09-30 21:16:25 +02:00
Fabien Potencier 550ac879b3 documentation #4958 3.x doc fixes (fabpot)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

3.x doc fixes

Commits
-------

1478f9efcd Fix the class name and a missing parenthesis in the runtime loader example
e883536e64 Replace the deprecated twig_test_even function in the custom test example
db3aeb7379 Use the current variable node class in the node tree example
2026-09-26 10:36:51 +02:00
Fabien Potencier 452419d64a documentation #4962 Fix the autoescape documentation about static expressions (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Fix the autoescape documentation about static expressions

Commits
-------

95a176f2bf Fix the autoescape documentation about static expressions
2026-09-26 10:36:25 +02:00
Fabien Potencier 677f049e64 Use sandbox policy examples that remain meaningful in Twig 4.0 2026-09-26 10:30:06 +02:00
Fabien Potencier 9d24327f8d Rewrite the sandbox documentation around what developers need to know 2026-09-26 10:02:08 +02:00
Fabien Potencier 1478f9efcd Fix the class name and a missing parenthesis in the runtime loader example 2026-09-25 23:53:05 +02:00
Fabien Potencier e883536e64 Replace the deprecated twig_test_even function in the custom test example 2026-09-25 23:53:05 +02:00
Fabien Potencier db3aeb7379 Use the current variable node class in the node tree example 2026-09-25 23:53:00 +02:00
Fabien Potencier 95a176f2bf Fix the autoescape documentation about static expressions 2026-09-25 23:45:00 +02:00
Fabien Potencier 26812ebc0d Expose the escaping strategy a template was compiled with 2026-09-21 11:30:11 +01:00
Fabien Potencier 55afb2e084 Deprecate cloning a Twig environment 2026-09-18 16:52:58 +01:00
Fabien Potencier d6b81f9074 Allow block chains to be composed of other block chains 2026-09-14 11:17:44 +02:00
Fabien Potencier 897717d78f Resolve block chains against the render context instead of freezing lineages 2026-09-12 00:03:19 +02:00
Fabien Potencier 49f814ea26 Template runtime and block composition 2026-09-11 04:57:38 -07:00
Fabien Potencier c32656815b minor #4908 Remove the documentation comments compilation overhead (fabpot)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

Remove the documentation comments compilation overhead

Documentation comments are now attached to semantic nodes during parsing, removing the dedicated AST traversal. Token parsers returning placeholder nodes can select the semantic documentation target.

Commits
-------

60eed4ccd5 Remove the documentation comments compilation overhead
2026-08-29 00:19:33 +02:00
Fabien Potencier 60eed4ccd5 Remove the documentation comments compilation overhead 2026-08-29 00:19:29 +02:00
Fabien Potencier fdfef2b14a Clarify source function trust requirements 2026-08-28 18:11:30 +02:00
Fabien Potencier 59f7d67848 Document that reusing a non-rewindable iterator after destructuring is unsupported 2026-08-27 13:43:07 +02:00
Fabien Potencier 099fa3471a Document that sequence destructuring consumes one value per pattern slot 2026-08-27 13:07:47 +02:00
Fabien Potencier abbdf82823 Fix the html_attr documentation about iterables in data attributes 2026-08-27 13:07:41 +02:00
Fabien Potencier be220e6fd8 Warn about untrusted input with the default Tempest markdown converter 2026-08-27 13:07:34 +02:00
Fabien Potencier 1205b8b6ca Document that overriding MacroNode::compile() is not supported anymore 2026-08-27 13:07:26 +02:00
Fabien Potencier 207f873739 Document that include_only keeps global variables available 2026-08-27 13:07:13 +02:00
Fabien Potencier cf971e1a59 Remove lazy macro import resolution 2026-08-27 12:17:08 +02:00
Fabien Potencier 1de0bfceb4 Honor date formatter prototype calendars 2026-08-27 08:44:26 +02:00
Hugo Alliaume 9b18e3757d Extract htmlAttrValue() from html_attr for standalone attribute rendering 2026-08-26 16:46:53 +02:00
Fabien Potencier e2014eb92a Fix Traversable sequence destructuring semantics 2026-08-23 09:40:21 +02:00
Fabien Potencier 6806e30474 Attach documentation comments to nodes 2026-08-19 16:41:17 +02:00
Fabien Potencier 9036d8c5aa feature #4434 Add the include_only function (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Add the include_only function

Commits
-------

dc8f96df3e Add the include_only function to render a template without access to the current context
2026-08-16 10:53:58 +02:00
Romain Monteil aa17f59877 Add support for tempest/markdown in markdown-extra 2026-08-12 13:02:21 +02:00
Fabien Potencier dc8f96df3e Add the include_only function to render a template without access to the current context 2026-08-11 20:58:31 +02:00
Fabien Potencier b53e100444 Nested macro imports 2026-08-03 10:30:32 +02:00
Fabien Potencier 34d9c67d38 Deprecate using parentheses when testing a macro with the defined test 2026-07-31 12:09:23 +02:00
Fabien Potencier d7f8b4eb1c Redesign macro calls and argument handling 2026-07-30 13:53:24 +02:00
Fabien Potencier b762bc94b9 Make the sandbox a first-class citizen with a dedicated Sandbox class 2026-07-30 12:05:47 +02:00
Fabien Potencier ad305b414e Deprecate macro calls without parentheses 2026-07-28 16:13:23 +02:00
Fabien Potencier a2a4c1b4f2 feature #4876 Rename macro variable AST nodes (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Rename macro variable AST nodes

The current name are just wrong as these classes are only used in the context of macros. They were confusing.

Commits
-------

be36fee09e Rename macro variable AST nodes
2026-07-28 12:07:42 +02:00
Fabien Potencier be36fee09e Rename macro variable AST nodes 2026-07-28 11:53:50 +02:00
Fabien Potencier 222a7f3f9a Clarify the security scope for untrusted templates 2026-07-28 08:40:21 +02:00
Fabien Potencier 258089b8a6 Deprecate duplicate macro definitions 2026-07-27 12:24:45 +02:00
Marilena Ruffelaere 02382585e9 add shadowing example 2026-07-20 18:57:40 +02:00
Marilena RUFFELAERE 7234d51ec8 Update for.rst
Add context and explanation about loop.parent
2026-07-17 15:42:51 +02:00
Fabien Potencier 29b66fd916 Document sandbox handling of magic __call() methods 2026-07-12 15:45:50 +02:00
Fabien Potencier 5bcd992138 feature #4852 [Intl] Add format_list filter using PHP 8.5's IntlListFormatter (BreyndotEchse)
This PR was squashed before being merged into the 3.x branch.

Discussion
----------

[Intl] Add format_list filter using PHP 8.5's IntlListFormatter

Adds a new `format_list` Twig filter to IntlExtension that formats arrays using using PHP 8.5's IntlListFormatter

On PHP < 8.5, using the filter throws a RuntimeError explaining the dependency on IntlListFormatter (Checks if `class_exists` to allow polyfills).

CI workflow only covered up to PHP 8.4, so I extended it to also run PHPUnit against 8.5.
phpstan's PHP version also bumped to 8.5.

Commits
-------

163f1b6341 [Intl] Add format_list filter using PHP 8.5's IntlListFormatter
2026-07-08 22:22:47 +02:00
Marvin Feldmann 163f1b6341 [Intl] Add format_list filter using PHP 8.5's IntlListFormatter 2026-07-08 22:22:44 +02:00
Matthieu Lempereur fc4dee393c fix version in deprecation message for tag usage outside of root template 2026-07-08 19:01:20 +02:00
Fabien Potencier ec0f5d5dad Tweak previous merge 2026-06-19 08:06:30 +02:00
Andy Blum 068a2e6cb4 Add documention note about variable scope of override blocks in {% embed ... only %} 2026-06-19 08:03:24 +02:00
Fabien Potencier a69d3dc71e Keep captured block definitions supported 2026-06-11 07:43:59 +02:00
Fabien Potencier 16e5a937ed Clarify captured block deprecation wording 2026-06-11 07:43:47 +02:00