November 2018
Intermediate to advanced
404 pages
10h 16m
English
The Leaf templating engine uses the # token to represent a tag, as seen in #(count) from the previous HTML code. The Leaf tag has general syntax: #Name( Args ){ Body }, where Name is the tag's name, Arg is a list of expected arguments, and Body is an optional element that often includes additional content.
Vapor provides many useful tagging usages and they are summarized in the following:
| Tag | Usage | |
|---|---|---|
| #capitalize(Var) | Converts Var into capitals | #capitalize(title) |
| #uppercase(Var) | Converts Var into all uppercase | #uppercase(title) |
| #lowercase(Var) | Converts Var into all lowercase | #lowercase(title) |
| #if(Condition) | Executes only if Condition is met | #if(title) { The title is #(title) } |
| #contains(Array, ... |
Read now
Unlock full access