class

Azu::Templates

Inherits Reference < Object

Templates are used by Azu when rendering responses.

Since many views render significant content, for example a whole HTML file, it is common to put these files into a particular directory, typically "src/templates".

This module provides conveniences for reading all files from a particular directory and embedding them into a single module. Imagine you have a directory with templates:

Templates::Renderable will define a private function named render(template : String, data) with one clause per file system template.

render(template : String, data)

Constructors

new(path : Array(String), error_path : String, hot_reload : Bool | Nil = nil)
Source

Instance methods

crinja
Source
error_path
Source
error_path=(path : String)
Source
hot_reload=(enabled : Bool)

Enable or disable hot reloading manually

Source
load(template : String)
Source
path
Source
path=(path : String)
Source

Nested types