* 1.x:
updated CHANGELOG
Call clearstatcache() before calling is_dir().
bumped version to 1.33
fixed CHANGELOG
Make "length" filter and "empty" test consider __toString [Twig 1.x]
* 1.x:
fixed tests for PHP 5.2
fixed tests for PHP 5.2
fixed tests for PHP 5.2
Fix typo in test filename
added a note in the docs about the PSR-11 runtime loader
fixed typo
updated CHANGELOG
bumped version to 1.32
Add ContainerRuntimeLoader
tweaked docs
Update striptags.rst
fixed CS
Mention autoescape=true deprecation (issue #2386)
Fix typo.
bumped version to 1.31.1-DEV
prepared the 1.31.0 release
added a note about macros usage in the deprecated docs
* 1.x:
updated CHANGELOG
fixed typo
feature #2045 Adds Twig_NodeCaptureInterface for nodes that capture all output
bumped version to 1.31.0
Delay marking the environment as initialized until it is done
Fix the argument name of filter replace
This PR was merged into the 2.x branch.
Discussion
----------
removed remaining mentions of the C extension
Commits
-------
57ebf00 removed remaining mentions of the C extension
* 1.x:
fixed CS
marked some classes as being final
Better type description on PHPDoc, better testing of returned value.
Make Twig_Error report real source path when possible
This PR was merged into the 1.x branch.
Discussion
----------
Better testing of operators returned by Extension
Add better testing and docs description about operators when using an extension.
Commits
-------
282df53 Better type description on PHPDoc, better testing of returned value.
* 1.x:
fixed message
improved a deprecation notice
bumped version to 1.28.2-DEV
prepared the 1.28.1 release
added tests for block() when using a template argument
fixed block() is defined call when using a template argument
Bugfix: When rendering blocks of other templates, don't pass the local blocks array.
fixed doc issues
fixed typo in the docs
fix wrong __CLASS__ constant
bumped version to 1.28.1-DEV
prepared the 1.28.0 release
fixed render block with template wrapper
This PR was merged into the 1.x branch.
Discussion
----------
Add a "with" tag
Closes#719, alternative implementation of #1054
Commits
-------
4366907 added with tag
This PR was merged into the 1.x branch.
Discussion
----------
added support for a custom template on the block() function
`block()` allows one to render a block of the current template.
This PR adds the possibility to use `block()` to render a block of another template:
```twig
{{ block('footer', template_name) }}
```
As it uses the same logic as for the regular `block()`, you can also use it in a test:
```twig
{% if block('footer', template_name) is defined %}
...
{% endif %}
```
This removes the needs to use the internal `Twig_Template::renderBlock()` method in the Symfony Web Profiler for instance. And combined with #2236, it allows us to really mark the whole `Twig_Template` class as being internal.
I'm aware that #1302 asked for being able to pass a context to `block()` (implemented in #1433), but I prefer not to in favor of adding the `with` tag (see #719 and #1054).
When the `with` will be implemented, the code in the Symfony Web Profiler will become something along the lines of:
```twig
{% with {
'collector': profile.getcollector(name),
'profiler_url': profiler_url,
'token': profile.token,
'name': name
} %}
{{ block('toolbar', template) }}
{% endwith %}
```
Commits
-------
5ed59be added support for a custom template on the block() function