Twig uses a syntax similar to the template languages found in Django and Jinja.
Twig is also the current templating engine used in the popular Symfony PHP framework.
The principle behind Twig is simple. It takes specific syntax and converts to plain (optimized) raw PHP code.
This enables developers to prototype their code and add various execution criteria and take into account various environment scenarios for their apps. You might imagine how really useful this can be for building large, dynamic Web apps.
What is new in this release:
- Twig 1.20.0 which contains a security vulnerability fix for Twig's Sandbox mode.
What is new in version 1.22.0:
- Twig 1.20.0 which contains a security vulnerability fix for Twig's Sandbox mode.
What is new in version 1.18.2:
- Fixed timezone on dates as strings
- Fixed 2-words test names when a custom node class is not used
- Fixed macros when using an argument named like a PHP super global (like GET or POST)
- Fixed date_modify when working with DateTimeImmutable
- Optimized for loops
- Fixed multi-byte characters handling in the split filter
- Fixed a regression in the in operator
- Fixed a regression in the slice filter
What is new in version 1.18.1:
- Fixed timezone on dates as strings
- Fixed 2-words test names when a custom node class is not used
- Fixed macros when using an argument named like a PHP super global (like GET or POST)
- Fixed date_modify when working with DateTimeImmutable
- Optimized for loops
- Fixed multi-byte characters handling in the split filter
- Fixed a regression in the in operator
- Fixed a regression in the slice filter
What is new in version 1.17.0:
- Fixed timezone on dates as strings
- Fixed 2-words test names when a custom node class is not used
- Fixed macros when using an argument named like a PHP super global (like GET or POST)
- Fixed date_modify when working with DateTimeImmutable
- Optimized for loops
- Fixed multi-byte characters handling in the split filter
- Fixed a regression in the in operator
- Fixed a regression in the slice filter
What is new in version 1.16.0:
- 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.
What is new in version 1.15.1:
- Added an error message when trying to import an undefined block from a trait.
- Fixed the conversion of the special '0000-00-00 00:00' date.
- Fixed a C extension crash when accessing defined but uninitialized property.
What is new in version 1.15.0:
- Made ignoreStrictCheck in Template::getAttribute() works with __call() methods throwing BadMethodCallException
- Added min and max functions
- Added the round filter
- Fixed a bug that prevented the optimizers to be enabled/disabled selectively
- Fixed first and last filters for UTF-8 strings
What is new in version 1.12.3:
- Fixed fatal error that should be an exception when adding a filter/function/test too late.
- Added a batch filter.
- Added support for encoding an array as query string in the url_encode filter.
What is new in version 1.12.2:
- Fixed the timezone used by the date filter and function when the given date contains a timezone (like 2010-01-28T15:00:00+02:00).
- Fixed globals when getGlobals is called early on.
- Added the first and last filter.
What is new in version 1.12.1:
- Added support for object instances as the second argument of the constant function.
- Relaxed globals management to avoid a BC break.
- Added support for {{ some_string[:2] }}.
What is new in version 1.11.1:
- Fixed debug info line numbering (was off by 2).
- Fixed escaping when calling a macro inside another one (regression introduced in 1.9.1).
- Optimized variable access on PHP 5.4.
What is new in version 1.9.2:
- Fixed the in operator for objects that contain circular references.
- Fixed the C extension when accessing a public property of an object implementing the \ArrayAccess interface.
Requirements:
- PHP 5.2.4 or higher
Bình luận không