Skip to content

Templates

class Azu::Templates
inherits Reference

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)

Class methods

.new(path : String, error_path : String)

View source

Methods

#error_path : String

View source

#error_path=(path : String)

View source

#load(template : String)

View source

#path : String

View source

#path=(path : String)

View source