? Easy-to-use foundation for building powerful templating languages in Swift.
Adds support for serializing URLs in templates (#38, fixes #64).
New:
DateFormat(defaultDateFormatterFactory: () -> DateFormatter)
(#45)DateFormat.iso8601
tag that uses ISO-8601 formatting (#45)New:
String.htmlEscaped()
method (#56)New:
TemplateDataEncoder
has been refactored for improved performance. (#50)DateFormatter
s are now cached during rendering for improved performance. (#51)Fixed:
DateFormat
now returns null when arguments are null. (#44)userInfo
does now get passed to nested scopes. (#53, #54)#for
on null array now returns null. (#55)Fixed:
UnsafeBufferPointer
in Swift 5. (#46)Fixed:
userInfo
is now correctly passed when using #embed
. (#41, #42)New:
ViewRenderer
now supports passing a userInfo
dictionary that will be accessible by TagRenderer
s. (#17, #28)return req.view().render("welcome", ["name": "Vapor"], userInfo: ["foo": "bar"])
final class FooTag: TagRenderer {
func render(_ tag: TagContext) -> ... {
print(tag.context.userInfo["foo"])
}
}
Fixed:
LeafDataEncoder
to properly recognize custom encoding methods. (#29, #20, #30).#date
tag crasher. (#23)Introducing Template Kit 1.0 ? Template Kit is an easy-to-use foundation for building powerful templating languages in Swift.
Docs: https://docs.vapor.codes/3.0/template-kit/getting-started/
API Docs: https://api.vapor.codes/template-kit/latest/TemplateKit
Milestone: 1.0.0
Changes since final release candidate:
Fixed:
TemplateData.future
case in favor of TagRenderer
s returning Future<TemplateData>
(was redundant previously).New:
isFirst
and isLast
variables alongside index
while using iterators.