Breaking changes
- Most built-in expression parsing functions/methods now expect the current
Environment
instance to be passed as the first argument.
Fixes
- Fixed
{% for %}
tag expressions with a comma between the iterable andlimit
,offset
orreversed
. Previously we were assuming a comma immediately following the iterable would mean we are iterating an array literal. We're also explicitly disallowinglimit
,offset
andreversed
arguments after an array literal.
Features
- Added optional filter argument validation at template parse time. (docs)
- Added lambda expressions as filter arguments. Both custom and built-in filters can accept arguments of the form
<identifier> => <boolean expression>
or(<identifier>, <identifier>) => <boolean expression>
. - Updated filters
map
,where
,sort
,sort_natural
,uniq
,compact
andsum
to accept lambda expression or string arguments. - Added filters
reject
,has
,find
andfind_index
.
Documentation
- Added documentation for the
json
filter's optionalindent
argument.