Commit Graph

135 Commits

Author SHA1 Message Date
Fabien Potencier 3197df7b5e Merge branch '3.x' into 4.x
* 3.x:
  Make the sandbox a first-class citizen with a dedicated Sandbox class

# Conflicts:
#	CHANGELOG
#	doc/deprecated.rst
#	doc/tags/sandbox.rst
#	phpstan-baseline.neon
#	src/Extension/CoreExtension.php
#	src/Extension/SandboxExtension.php
#	src/Sandbox/SecurityPolicy.php
2026-07-30 13:04:50 +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 463ef4018d Merge branch '3.x' into 4.x
* 3.x:
  Update CHANGELOG
  Add `html_attr_relaxed` escaping strategy
  re-add mixed return type
  Support short-circuiting in null-safe operator chains
  Add support for renaming variables in object destructuring
  Update .gitattributes to remove splitsh.json
  Fix intro for operator precedence table ?
2026-02-09 12:29:34 +01:00
Matthias Pigulla 04aa3df49f Add html_attr_relaxed escaping strategy 2026-02-08 18:59:07 +01:00
Fabien Potencier 0222460a72 Merge branch '3.x' into 4.x
* 3.x:
  Bump version
  Add a not about the return value of destructuring
  Fix null-safe operator test
  Bump version
  Prepare the  release
  Update CHANGELOG
  Add support for object and mapping destructuring
  Rename classes
  Assignment operator array destructuring
  Fix doc notes
  Fix doc notes
  Add the = assignment operator
  Fix grammar and spelling mistakes in documentation
2026-02-06 22:45:48 +01:00
Fabien Potencier 77cd2fd9f7 Fix grammar and spelling mistakes in documentation 2026-01-17 22:34:06 +01:00
Nicolas Grekas c2b04ec6d9 Merge branch '3.x' into 4.x
* 3.x:
  Escaper performance: avoid static variables
  Fix compatibility with Symfony 8
  Add documentation for use_yield option
  Stof suggestion about empty content
  Update templates.rst: Removing duplication
  Update configuration keys + allow extra keys for extensions
  replace typographic quote with straigt single quote
  Add TwigCsFixer in tools list
  Update reduce.rst
  Bump version
  Prepare the 3.21.1 release
  Update CHANGELOG
  Fix warning
  Fix instantiation
2025-07-29 10:22:22 +02:00
hschletz b8827b412d Add documentation for use_yield option
Documentation was present in the source code, but missing in the docs.
2025-07-02 12:45:53 +02:00
Fabien Potencier b0bb57c82a Remove versionadded in docs 2025-03-21 10:09:05 +01:00
Fabien Potencier bf65bf2948 Merge branch '3.x' into 4.x
* 3.x:
  Fix wrong array index (again)
  fix: update extension references in docs to use backticks
  [Doc] Fix `code-block` in html_cva
  [Docs] Replace `=` by `:` in code examples
  fix: deprecated documentation
  Use `:` instead of `=` for named argument in the docs
  use EmptyNode instead of an Nodes instance without children
  Fix `ModuleNode` instanciation when `$embeddedTemplates` is null
  merge the Nodes and Node sections
  reduce the number of deprecations being triggered
2025-03-21 10:08:16 +01:00
Simon André 239a060d59 fix: update extension references in docs to use backticks 2025-03-20 08:35:48 +01:00
Fabien Potencier ef7ade8ee3 Merge branch '3.x' into 4.x
* 3.x: (30 commits)
  Make {} optional for the types tag
  Remove the note about types mapping argument
  Add a note on the types locality
  Fix CS
  Fix typos in the docs
  Use spl_object_id() instead of spl_object_hash()
  Add `LastModifiedExtensionInterface` and implementation in `AbstractExtension` to track modification of runtime classes
  Bump version
  Optimize NameExpression compilation
  Fix typo in enum twig doc functions
  Remove dead method in ModuleNode
  Bump version
  Prepare the 3.18.0 release
  Add support for `Twig\Markup`
  Fix unary operator precedence change
  Replace Twigfiddle by the new Twig playground
  Fix MacroNode $name argument can be overridden
  Ignore exceptions from undefined handlers when using the guard tag
  [Doc] Update the docs about attribute() function
  Fix doc
  ...
2025-01-10 08:41:31 +01:00
Fabien Potencier f2f03d7629 Fix typos in the docs 2025-01-02 21:31:30 +01:00
Fabien Potencier f99eab8541 feature #4504 Add a way to stream template rendering (fabpot)
This PR was merged into the 3.x branch.

Discussion
----------

Add a way to stream template rendering

Even if we're using `yield` internally, there is no easy way to stream template rendering. This new method can be used like this to HTTP stream a template with Symfony:

```php
use Symfony\Component\HttpFoundation\StreamedResponse;
use Twig\Environment;

$twig = new Environment(/* ... */);

$response = new StreamedResponse($twig->load('index')->stream([]));
$response->send();
```

Commits
-------

1915ee2812 Add a way to stream template rendering
2024-12-18 19:14:01 +01:00
Pepperoni1337 03792f643f Use .html.twig file extension in documentation instead of .html 2024-12-18 11:01:27 +01:00
Fabien Potencier 1915ee2812 Add a way to stream template rendering 2024-12-18 07:29:32 +01:00
Fabien Potencier 43de153213 Merge branch '3.x' into 4.x
* 3.x:
  Move sandbox docs to its own chapter in the docs
  Deprecate passing a string or an array to Twig callable arguments accepting arrow functions (pass a Closure)
  Fix markup
  Update html_cva.rst
  Fix markup
  Fix markup
  Added informations in format_currency and format_number docs
  Clarify docs for some operators
2024-10-04 21:05:35 +02:00
Fabien Potencier 6688a8df16 Move sandbox docs to its own chapter in the docs 2024-10-04 21:00:19 +02:00
Fabien Potencier 9700212005 Merge branch '3.x' into 4.x
* 3.x:
  Rename a variable for more clarity
  Set IteratorAggregate generics for Node
  Add cross-link
  Let's no deprecate the attribute function yet
  Add more precise types for the registration of safe classes
  Clarify coding standards
  Fix markup
  Fix markup
  Clarify docs for the u filter
  Allow to use a dynamic attribute on the . operator via ()
  Remove most usage of foo/bar/baz in the docs
  Tweak docs
  Add StringCastUnary
2024-09-14 10:51:19 +02:00
Fabien Potencier 08f28fd06c Remove most usage of foo/bar/baz in the docs 2024-09-12 21:40:08 +02:00
Fabien Potencier 9b9196c9d6 Merge branch '3.x' into 4.x
* 3.x:
  Deprecate the sandbox tag
  Removed @internal on Environment::getGlobals()
  Clarify docs on registerUndefinedTokenParserCallback()
  Simplify code
2024-09-10 22:43:00 +02:00
Fabien Potencier 9369a48c53 Deprecate the sandbox tag 2024-09-10 22:41:00 +02:00
Fabien Potencier 7cfcefcaef Remove deprecated code 2024-08-28 14:01:55 +02:00
Fabien Potencier e2f0128774 Merge branch '3.x' into 4.x
* 3.x:
  Deprecate the fact that the `extends` and `use` tags are always allowed in a sandboxed template
  Clarify block function
2024-08-28 13:56:42 +02:00
Fabien Potencier 5fca700cbd Deprecate the fact that the extends and use tags are always allowed in a sandboxed template 2024-08-28 13:40:53 +02:00
Fabien Potencier 86330fb9bc Update docs 2024-08-23 09:26:18 +02:00
Fabien Potencier 7a4f6ea6ff Update docs 2024-08-23 09:25:12 +02:00
Simon André 21f08dcfe2 Add return types missed in #4211 2024-08-17 23:34:44 +02:00
Fabien Potencier de7767814b Remove deprecate feature in docs 2024-07-28 10:14:39 +02:00
Fabien Potencier c097774d99 Remove deprecated code 2024-07-28 10:14:26 +02:00
Fabien Potencier 1c6f44e095 Fix markup 2024-07-08 14:32:51 +02:00
Simon André 491a84175d Document OPTIMIZE_TEXT_NODES
(and remove obselete OPTIMIZE_VAR_ACCESS)
2024-06-30 10:13:10 +02:00
Fabien Potencier 1ed424d565 Clarify the behavior when a property/method does not exist 2024-01-24 07:16:36 +01:00
Fabien Potencier 31629a69f7 Merge branch '2.x' into 3.x
* 2.x:
  Fix a typo in api.rst
  Fix a typo advanced.rst
2021-11-29 09:51:28 +01:00
Dmitriy Fishman 68d59ab8c4 Fix a typo in api.rst 2021-11-29 07:20:05 +02:00
Fabien Potencier 155f7404df Merge branch '2.x' into 3.x
* 2.x:
  Fix typo
  Typo
2020-11-27 14:05:45 +01:00
Fabien Potencier c5379903e5 Merge branch '1.x' into 2.x
* 1.x:
  Fix typo
  Typo
2020-11-27 14:05:37 +01:00
Fabien Potencier 2f0947e1af Fix typo 2020-11-27 14:05:10 +01:00
Olaf van der Spek 43f382ba1b Typo 2020-11-27 14:04:41 +01:00
Fabien Potencier 22537dd1c4 Merge branch '2.x' into 3.x
* 2.x:
  Fix small typo
  Fix: Typo
  Enhancement: Use GithubActions instead of Travis for tests
  Fix: DOCtor-RST build
  Enhancement: Use no_explicit_use_of_code_block_php rule
  Fix: Highlighting
  Enhancement: Introduce DOCtor-RST config + Sphinx build + GithubActions
  Enhancement: Use GithubActions instead of Travis for tests
  Fix `odd` not working for negative numbers
  Bump version to 2.14.2-DEV
  Prepare the 2.14.1 release
  Update CHANGELOG
  Bump version to 1.44.2-DEV
  Prepare the 1.44.1 release
2020-11-05 18:38:00 +01:00
Fabien Potencier c2a264a91d Merge branch '1.x' into 2.x
* 1.x:
  Enhancement: Introduce DOCtor-RST config + Sphinx build + GithubActions
  Enhancement: Use GithubActions instead of Travis for tests
  Fix `odd` not working for negative numbers
  Bump version to 1.44.2-DEV
  Prepare the 1.44.1 release
2020-11-05 13:31:01 +01:00
Oskar Stark c9328ad613 Enhancement: Introduce DOCtor-RST config + Sphinx build + GithubActions 2020-11-05 13:09:07 +01:00
Fabien Potencier 050fdf54b8 Merge branch '2.x' into 3.x
* 2.x:
  Update api.rst
  Fix typo
  Fix typos
  Fix CI on PHP5
2020-04-24 08:31:57 +02:00
Fabien Potencier de4e46e77e Merge branch '1.x' into 2.x
* 1.x:
  Update api.rst
  Fix typo
  Fix CI on PHP5
2020-04-24 08:31:39 +02:00
Yohann Durand abe625a1a1 Update api.rst 2020-04-24 08:25:17 +02:00
Fabien Potencier e5ae15e7de Merge branch '2.x' into 3.x
* 2.x:
  support Sf5
  Fix constraints
  Update doc with new escaping behavior
  Remove obsolete page
  language typo
  Add missing suggestions in Twig Extra Bundle
2019-12-28 08:09:27 +01:00
Fabien Potencier e74a51ecb1 Merge branch '1.x' into 2.x
* 1.x:
  Update doc with new escaping behavior
  Remove obsolete page
  language typo
2019-12-28 08:09:20 +01:00
Laurent VOULLEMIER 92e1cd35c5 Update doc with new escaping behavior
When applied on ternary statements
2019-12-27 08:28:48 +01:00
Fabien Potencier e9f5fff78f Merge branch '1.x' into 3.x
* 1.x:
  Add missing link in docs
  Correct return type of twig_date_converter
2019-12-09 17:39:23 +01:00
Fabien Potencier 46e232b37c Merge branch '1.x' into 2.x
* 1.x:
  Add missing link in docs
  Correct return type of twig_date_converter
2019-12-09 17:39:17 +01:00