Releases
v2.9.0
Compare
Sorry, something went wrong.
No results found
dg
released this
16 Nov 00:03
New Features
possibility to {include block from file}
filter |sort, |clamp & custom function clamp()
added {ifchanged}
added {skipIf}
added {foreach} {else} {/foreach}
added {try} & {else} & {rollback}
added {embed file.latte}
added local blocks {block local name} & {define local name}
{case 1, 2, 3} accepts more than one option
syntax {include block foo} and {include file foo}
syntax {ifset block foo}
syntax {ifset #$blockName}
added $iterator->parent, returns the iterator surrounding the current one
added $iterator->counter0, returns 0-indexed counter
implemented support for named arguments
added null-coalescing-safe operator ??->
Improvements & Fixes
template code: direct HTML changed to 'echo' statements
BlockMacros: fixed variables visibility between blocks depend on block order [Closes #178 ]
FilterExecutor::filterContent() converts HtmlStringable to text [Closes #215 ]
Compiler: supports uppercases AND|OR|XOR [Closes #172 ]
BlockMacros: big refactoring
Template & BlockMacros: used new class Block, removed $blockQueue & $blockTypes
Template: removed old accumulator $_b (deprecated in 2.4, BC break)
added Defaults: default filters list moved here from FilterExecutor
CoreMacros: replaced global queuened temporary variables with local ones
BlockMacros: snippet driver wrapped in try ... finally
Parser: fixed parsing {__()} [Closes #226 ]
checks for valid macro/filter/function/block names
macros validates arguments, modifiers, position (MacroNode::validate())
{debugbreak} uses only xdebug
changed word 'macro' --> 'tag' in exception messages
CachingIterator: do not ask when not in valid state (#230 )
improved typehints
PhpHelpers::reformatCode() appends correctly semicolon after '${""}'
Changes
Colons as argument separators in modifiers are deprecated (BC break)
optional chaining: operator ?-> in Latte behaves the same as in PHP (BC break)
optional chaining: deprecated support for $var? and $obj?::$prop to be consistent with PHP 8 (BC break)
internal variables are prefixed $__ and disallowed to be used
Template: changed $contentType and $blocks to constants CONTENT_TYPE & BLOCKS
Template & BlockMacros: moved snippets to own layer, removed '_' prefix
You can’t perform that action at this time.