TemplateValues¶
A scoped key-value store for template rendering. Values are stored as
TemplateValue entries and looked up by name. Lookups check the local
scope first, then walk up the parent chain.
Use scope() to create a writable child that inherits all values from
this set without copying. Use update() and unescaped() to add values.
Constructors¶
create¶
Returns¶
- TemplateValues ref^
Public Functions¶
apply¶
Parameters¶
- name: String val
Returns¶
- TemplateValue box ?
update¶
Store a value under the given name. String values are wrapped in a
TemplateValue automatically. This is also the target of Pony's
sugar for values("key") = "value".
Parameters¶
- name: String val
- value: (String val | TemplateValue box)
Returns¶
- None val
unescaped¶
Store a string value that bypasses HTML auto-escaping in HtmlTemplate.
See TemplateValue.unescaped for details. For structured values (with
properties or sequences), use TemplateValue.unescaped() directly and
pass the result to update().
Parameters¶
Returns¶
- None val
scope¶
Create an empty writable child scope backed by this value set as a read-only parent. Writes go to the child; lookups that miss in the child fall through to the parent.
Returns¶
- TemplateValues ref