| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| README.md | 2025-11-26 | 1.5 kB | |
| Released version 3.1.0 source code.tar.gz | 2025-11-26 | 103.7 kB | |
| Released version 3.1.0 source code.zip | 2025-11-26 | 211.1 kB | |
| Totals: 3 Items | 316.4 kB | 0 | |
This major release introduces Smart HTML Attributes, strict_types by default, and several syntax improvements. It requires PHP 8.2+.
Smart HTML Attributes
* Null values: Attributes with null values are now dropped instead of rendering as empty strings.
* Boolean attributes: Attributes like checked or disabled render conditionally based on truthy/falsey values.
* Array support: class and style attributes now accept arrays (e.g., class="{[active: $cond]}").
* Data attributes: data-* attributes automatically JSON-serialize non-string values (arrays, objects, booleans).
* Aria attributes: aria-* attributes render boolean values as "true"/"false".
* Type checking: Passing invalid types (arrays, objects) to standard attributes now triggers a warning and omits the attribute.
New Features
* Added n:elseif support.
* Added nullsafe filter operator ?| (e.g., {$var?|upper}).
* Added |toggle filter for manual boolean attribute control.
* Support for unquoted n-attribute syntax: n:if={$cond}.
* Added Engine::setMigrationWarnings() to help detect changes in attribute rendering.
Breaking Changes & Deprecations
* strictTypes is now enabled by default.
* Using $this and $__* variables in templates is deprecated.
* The undefined unsafe operator ??-> is deprecated (use ?->).
* Global constants should now be prefixed with a slash (e.g., \PHP_VERSION).
* Engine::addFilterLoader() is deprecated.