Releases: nette/latte
Releases · nette/latte
Released version 3.1.1
- added LinterExtension for validating filters, functions, classes and methods
- linter: improved finding files, excludes temp, vendor, node_modules
- support every argument syntax for
clone()in PHP 8.5 - added CustomFunctionCallNode for custom functions
- refactor: decentralize operator precedence to individual nodes
- *CallableNode replaced with solution with VariadicPlaceholder (BC break)
- ErrorSuppressNode & NotNode merged into UnaryOpNode (BC break)
- deprecated
PrintContext::infixOp(),prefixOp(),postfixOp()(BC break) - fixed operator ! priority
Release version 3.0.25
- Escaper: supports converting HTML => TEXT
- Escaper: fixed converting between HTML/ATTR
<=>HTML - added
ModifierNode::removeFilter() - linter: added assets extension
Released version 3.1.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
nullvalues are now dropped instead of rendering as empty strings. - Boolean attributes: Attributes like
checkedordisabledrender conditionally based on truthy/falsey values. - Array support:
classandstyleattributes 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:elseifsupport. - Added nullsafe filter operator
?|(e.g.,{$var?|upper}). - Added
|togglefilter 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
strictTypesis now enabled by default.- Using
$thisand$__*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.
Released version 3.0.24
- Released version 3.0.24
- support for PHP 8.5
- added support for pipe operator in PHP 8.5
- added support for new deref without parens in PHP 8.4
- added
Engine::setSyntax()to set default syntax (#359) - refactor: moved script tag quote validation from PrintNode to compiler pass
- Tag parser: checks octal sequence overflow
Engine::getCacheKey()reflects strictTypes & strictParsing, ignores filemtime of extensionsElementNode::getAttribute()uses case-insensitive comparison in XML- NAttrNode: renamed temporary variables not to collide with n:snippet
Released version 3.0.22
- TagParser: allowed |
filter()and bitwise OR PrintContext::format()parenthesizes %node if it has lower precedence than the assignment operator- PrintContent: refactoring and updated operator precedence and associativity table
Cache::generateFileName()file name always contains 'latte--'- added /** Generated by Latte */ comment
- n:else: fixed when there are multiple TextNode
- PrintNode moved to Latte\Compiler\Nodes
- Nodes: removes null nodes after traversal
Released version 3.0.22
- added function
hasTemplate() - added |firstLower
- added NodeTraverser::RemoveNode constant #396
- improved block/template dynamic name checking
- optimized global function calls
Released version 3.0.21
Released version 3.0.20
{default}is evaluated lazily|localDaterespects the time zone set in PHP #380- added
|filter - FileLoader: fixed path normalization for phar and absolute paths #378
- TagParser: allow trailing comma in |filter(...)
- TranslatorExtension:
translate()can return \Stringable #372 CachingIterator::__get()does not return a reference
Released version 3.0.18
- added support for locale, affects
|localDate,|number,|bytesand|sortfilters - {import} supports arguments
- coreParentFinder is called only for main template (BC break)
- support for PHP 8.4
Released version 3.0.16
- added filter
|group& functiongroup() - filter
|sortaccepts iterable - filter
|sortaddedby&byKey Filters::first()accepts iterable- Engine: cache-key divided into key and signature, that is stored in a lock file
- Engine: added underscore to template class name
Loader::isExpired()deprecatedBlueprint::printClass()rewritten (BC break)