a Sensio Labs Product

The flexible, fast, and secure
template language for PHP

Twig 1.16.0 released

Twig 1.16.0 has just been released:

  • changed url_encode to always encode according to RFC 3986
  • fixed inheritance in a ‘use’-hierarchy
  • removed the __toString policy check when the sandbox is disabled
  • fixed recursively calling blocks in templates with inheritance

PEAR packages won’t be published anymore

I’ve been publishing PEAR packages for Twig since the very first public version. But now that Composer became the de-facto standard for dependency management, I think it’s time to stop generating new PEAR packages for Twig.

So, from now on, I won’t publish PEAR packages for new versions of Twig. That said, the current PEAR channel will continue to work, and I don’t expect to close it anytime soon (you just won’t get any new versions).

Twig 1.15.1 released

Twig 1.15.1 comes with the following bug fixes:

  • fixed the conversion of the special ‘0000-00-00 00:00’ date
  • added an error message when trying to import an undefined block from a trait
  • fixed a C extension crash when accessing defined but uninitialized property.

Twig 1.15.0 released

I’m very happy to announce the immediate availability of Twig 1.15.0.

This version comes with new functions: max and min, a new filter: round, and a new function: source.

It also fixes some issues with the C extension when using the sandbox.

Last, but not the least, the Template::getAttribute() works better when one of your classes uses __call() and throws a BadMethodCallException exception when the method is not supported.

Twig 1.14.2 released

When an error occurs during tempating rendering, Twig tries to find the original template name and line where the error occurred. Under some circumstances, the guess algorithm was wrong and 1.14.2 fixes that.

Twig 1.14.1 released

Twig 1.14 introduced a regression as you are not able to have a variable named “matches” anymore.

1.14.1 fixes this regression and it goes one step further by removing one restriction: you can now use variables with a name that conflicts with a named operator (like in, is, matches, and any custom one you might have created).

Twig 1.14.0 released

Twig 1.14.0 has been released. This new version contains a lot of new features and improvements. This is also the first Twig release that supports HHVM.

Here are the major changes in this version:

  • fixed usage of the html_attr escaping strategy to avoid double-escaping with the html strategy
  • added new operators: ends with, starts with, and matches
  • fixed some compatibility issues with HHVM
  • added a way to add custom escaping strategies
  • fixed the C extension compilation on Windows
  • fixed the batch filter when using a fill argument with an exact match of elements to batch
  • fixed the filesystem loader cache when a template name exists in several namespaces
  • fixed template_from_string when the template includes or extends other ones
  • fixed a crash of the C extension on an edge case

Note that named arguments for macros support was removed before the release as it was not ready yet.

Twig 1.13.2 released

Twig 1.13.2 fixes two bugs:

  • fixed the error line number for an error occurs in and embedded template
  • fixed crashes of the C extension on some edge cases

Twig 1.13.1 released

Twig 1.13.1 is out and contains some minor bug fixes:

  • added the possibility to ignore the filesystem constructor argument in Twig_Loader_Filesystem
  • fixed Twig_Loader_Chain::exists() for a loader which implements Twig_ExistsLoaderInterface
  • adjusted backtrace call to reduce memory usage when an error occurs
  • added support for object instances as the second argument of the constant test
  • fixed the include function when used in an assignment

Twig 1.13.0 released

Twig 1.13.0 has just been released. It contains nice speed optimizations for the escaping filter. Here is the full changlog:

  • fixed getting a numeric-like item on a variable (‘09’ for instance)
  • fixed getting a boolean or float key on an array, so it is consistent with PHP’s array access: {{ array[false] }} behaves the same as echo $array[false]; (equals $array[0])
  • made the escape filter 20% faster for happy path (escaping string for html with UTF-8)
  • changed ☃ to § in tests
  • enforced usage of named arguments after positional ones
This website is powered by PHP and Twig.