class Azu::Templates

Overview

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)

Defined in:

azu/templates.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(path : Array(String), error_path : String) #

[View source]

Instance Method Detail

def crinja : Crinja #

[View source]
def error_path : String #

[View source]
def error_path=(path : String) #

[View source]
def load(template : String) #

[View source]
def path : Array(String) #

[View source]
def path=(path : String) #

[View source]