November 2018
Intermediate to advanced
404 pages
10h 16m
English
After registering and configuring for the Leaf templating engine, you're about to explore some basic functions offered by Leaf.
Follow these steps to render the main page using Leaf:
import Leaf
router.get { req -> Future<View> in // [1] let leaf = try req.make(LeafRenderer.self) // [2] let context = [String: String]() // [3] return leaf.render("main", context) // [4]}
There are four steps involved in rendering a page:
Read now
Unlock full access