Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/saur/view/template.js>default

a rapid web development framework for deno
Latest
class default
import { default } from "https://deno.land/x/saur@v0.0.1/view/template.js";

Template reads and compiles a template to render the response for a View, using the View as context. Templates have a conventional filename, ${path_to_template}.${response_format}.${templating_language}. A "users/show" page for HTML would therefore have a template of users/show.html.ejs, while the same route for XML would use the users/show.xml.ejs template.

Constructors

new
default(
path,
format,
view,
)

Properties

readonly
layout
readonly
layoutName

Methods

compile(path, context)

Compile this template using the template handler.

partial(view)

Render this template without its outer layout.

render(view)

Render this template and wrap it in a layout.