819 Commits

Author SHA1 Message Date
Fabien Potencier f5596be101 Merge branch '1.x' into 2.x
* 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]
2017-03-22 08:12:17 -07:00
Matthias Pigulla f5193e92c5 Make "length" filter and "empty" test consider __toString [Twig 1.x] 2017-03-22 07:33:03 -07:00
Fabien Potencier ea2ca30d00 Merge branch '1.x' into 2.x
* 1.x:
  Updated the vim-twig link
  PHPUnit 6 compatability
  Fix codeblock
  Update Compiler.php
2017-03-12 08:30:20 -07:00
Evaldo Junior 955d5abd92 Updated the vim-twig link
The other project is not maintained anymore and the author recommends this fork.
2017-03-12 08:19:54 -07:00
aaa2000 adba4c2a2b Fix codeblock 2017-03-10 08:51:30 -08:00
Fabien Potencier 4569e476a8 Merge branch '1.x' into 2.x
* 1.x:
  fixed CS
  #1802 left/right trim
2017-02-23 06:55:46 -08:00
Fabien Potencier af0d787c43 fixed CS 2017-02-23 06:54:27 -08:00
Antony D'Andrea 7d8e75504c #1802 left/right trim 2017-02-23 06:52:03 -08:00
Fabien Potencier 236c429ee0 Merge branch '1.x' into 2.x
* 1.x:
  added some missing tests
2017-02-21 18:52:53 -08:00
Fabien Potencier 236c1bdc32 added some missing tests 2017-02-21 18:49:28 -08:00
Fabien Potencier 3cf0ac46f4 tweaked docs 2017-02-17 11:35:58 -08:00
Fabien Potencier 9578c35227 Merge branch '1.x' into 2.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
2017-02-17 11:32:53 -08:00
Fabien Potencier 7efe539b82 added a note in the docs about the PSR-11 runtime loader 2017-02-17 11:16:50 -08:00
Victor Bocharsky 8a62689d44 Change '~' with '^' for version in composer require
Caret symbol sticks closer to semantic versioning, and will always allow non-breaking updates
2017-02-16 09:57:42 +02:00
Fabien Potencier d6715ac8c3 tweaked docs 2017-02-03 13:34:15 -08:00
Peter Potrowl 048f549017 Update striptags.rst 2017-02-03 13:32:21 -08:00
Fabien Potencier 73de309fb4 fixed CS 2017-02-03 13:30:43 -08:00
Stéphane Lavergne 70d03042df Mention autoescape=true deprecation (issue #2386) 2017-02-03 13:29:55 -08:00
Fabien Potencier c9a14464a3 added a note about macros usage in the deprecated docs 2017-01-11 11:20:42 -08:00
Fabien Potencier a92ec89b31 Merge branch '1.x' into 2.x
* 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
2017-01-10 14:07:32 -08:00
Fabien Potencier 5c8a624963 fixed class names 2017-01-05 11:38:57 -08:00
Fabien Potencier 48b2f5cef0 added the missing deprecated doc 2017-01-05 09:36:31 -08:00
Jean pasqualini c8f69d764b Fix the argument name of filter replace
The argument name in the code is $from

See https://github.com/jean-pasqualini/Twig/blob/1.x/lib/Twig/Extension/Core.php#L475.

Issue : https://github.com/twigphp/Twig/issues/2329
2017-01-05 18:35:52 +01:00
Fabien Potencier ad0564a7ee Merge branch '1.x' into 2.x
* 1.x:
  updated copyright year
  Minor typo in class name
  fixed CS
2017-01-02 12:22:25 -08:00
Benjamin Paap ce90852541 Minor typo in class name 2016-12-29 22:21:24 +01:00
Fabien Potencier 166922bcfe feature #2318 removed remaining mentions of the C extension (fabpot)
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
2016-12-24 11:36:01 +01:00
Fabien Potencier 8aee0809c3 fixed version in documentation 2016-12-24 09:08:07 +01:00
Fabien Potencier 57ebf004e7 removed remaining mentions of the C extension 2016-12-24 08:57:01 +01:00
Fabien Potencier f03ddaef43 Merge branch '1.x' into 2.x
* 1.x:
  added more final classes
  add a comma to clarify the meaning
2016-12-23 09:06:20 +01:00
Christian Flothmann 7cd3c9d25f add a comma to clarify the meaning
Without the comma you could understand that the "if" not only applied
to `-1`, but to `1` as well if you read too quickly.
2016-12-23 08:52:50 +01:00
Fabien Potencier b7a5597f09 Merge branch '1.x' into 2.x
* 1.x:
  tweaked a deprecation notice
  added more docs about the range function
2016-12-23 07:53:11 +01:00
Fabien Potencier 40348480e7 added more docs about the range function 2016-12-23 07:21:48 +01:00
Fabien Potencier 747d7bea87 dropped PHP 5.x support 2016-12-21 10:34:59 +01:00
Fabien Potencier c795267a4d Merge branch '1.x' into 2.x
* 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
2016-12-13 11:18:37 +01:00
Fabien Potencier ed37fc72e1 minor #2290 Better testing of operators returned by Extension (SpacePossum)
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.
2016-12-13 10:48:03 +01:00
Fabien Potencier e89c712f58 marked some classes as being final 2016-12-10 08:40:37 +01:00
SpacePossum 282df533de Better type description on PHPDoc, better testing of returned value. 2016-12-09 08:12:45 +01:00
Fabien Potencier 8ab764b4d3 added support for {{ _self }} to provide an upgrade path from 1.x to 2.0 2016-12-08 08:54:19 +01:00
Fabien Potencier 2675139c93 Merge branch '1.x' into 2.x
* 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
2016-11-19 11:45:49 -08:00
Fabien Potencier 629810c91e fixed doc issues 2016-11-18 10:07:48 -05:00
Fabien Potencier 9c9816874d fixed typo in the docs 2016-11-18 09:49:07 -05:00
Fabien Potencier 183f062bbf removed obsolete code 2016-11-15 17:01:14 -05:00
Fabien Potencier 5a7b20205d Merge branch '1.x' into 2.x
* 1.x:
  exposed a way to access template data and methods in a portable way
  removed optimization as it's not compatible with Symfony cache system
2016-11-15 16:57:15 -05:00
Fabien Potencier d7062f35b8 exposed a way to access template data and methods in a portable way 2016-11-12 19:45:39 -08:00
Fabien Potencier 4c39e930cd remove obsolete docs 2016-11-12 18:12:38 -08:00
Fabien Potencier 26fefedbae Merge branch '1.x' into 2.x
* 1.x:
  updated CHANGELOG
  added with tag
  added missing docs
  added support for a custom template on the block() function
2016-11-12 18:11:17 -08:00
Fabien Potencier aa2ca14e88 feature #2246 Add a "with" tag (fabpot)
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
2016-11-12 17:41:49 -08:00
Fabien Potencier 4366907d73 added with tag 2016-11-12 17:40:47 -08:00
Fabien Potencier 02b084e2f5 feature #2245 added support for a custom template on the block() function (fabpot)
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
2016-11-12 17:38:59 -08:00
Fabien Potencier 065b2e26a2 added missing docs 2016-11-12 17:36:55 -08:00