All notable changes to jinja-php will be documented in this file.
- [Fix] Object literal interpretation by @drjamesj in #4
- Feat: improve code quality and fix runtime argument passing bugs by @CodeWithKyrian in #5
- @drjamesj made their first contribution in #4
Full Changelog: https://github.com/CodeWithKyrian/jinja-php/compare/2.0.0...2.1.0
Core Language Features
- Added macro support with
{% macro %}and{% endmacro %}blocks - Added break and continue statement support for loops
- Added ternary expressions and improved
if-elseparsing withelifsupport - Added spread expressions (
*args) for function argument unpacking - Added comment support with
{# #}syntax - Added null literal support (
none,None)
Template Processing
- Added custom transformers-specific
generationtag support - Added string concatenation operator (
~) and multiple string literal support - Enhanced set statements with body support and
{% endset %}blocks - Added
for-elseloops with{% else %}blocks
String Manipulation
- Added new filters:
capitalize,replace,splitwith maxsplit,join - Enhanced
startswith/endswithfilters with tuple argument support - Added
items,keys,valuesmethods for object iteration - Added trimming functions:
strip,lstrip,rstrip
Data Processing
- Added Python-style negative array indexing (e.g.,
messages[-1]) - Added new filters:
tojson,map,indent - Added proper numeric type handling with
IntegerValueandFloatValue - Added support for both lowercase and uppercase boolean literals
- Fixed undefined array key errors in parser and lexer with proper bounds checking
- Improved error messages and exception handling throughout
- Enhanced parser architecture with better statement detection
- Added
JsonSerializableinterface to runtime values
None - all changes are backward compatible.
- @dkeetonx made their first contribution in #3
Full Changelog: https://github.com/CodeWithKyrian/jinja-php/compare/1.0.0...2.0.0
- Jinja Syntax Support - It supports most of the Jinja Syntax
- ML Chat Templates Ready - It has been tested against most of the Chat Templates on HuggingFace
- General Templating: It is versatile enough to be used for regular templating tasks.
Full Changelog: https://github.com/CodeWithKyrian/jinja-php/commits/1.0.0