Documentation
¶
Overview ¶
Package lazyview provides a simple view rendering engine.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
Ctx context.Context
Writer io.Writer
Variables map[string]any
// Content represents the view content. If defined, Action and Partial are ignored as only the layout is rendred
Content string
// Action to render
Action string
// Partial to render. If Action is defined, this is ignored.
Partial string
Controller string
Namespace string
// Variants allows to specified a variant preference for the view.
// For example, a mobile variant will expect the view to be named as "index.html+mobile.tpl"
// If empty, no variants are used.
// To allow the default variant, use an empty string.
Variants []string
// Formats is the list of formats to search for. Eachone is represented as a file extension.
// If empty, and Accept is not defined, it will default to ["html", "json"]
Formats []string
// Acept is the Accept header value. It is only read is Format is empty.
// Each mime type is converted to the common file extension as defined by the mime package.
Accept string
// UseLayout determines if the layout should be used.
UseLayout bool
// Layout defines which layout should be used.
// If empty the default layout will be used.
Layout string
}
Options is the set of options to render a view. In case there are several views that match the search criteria, this is the list of priorities: SearchPaths > Variants > Namespace/Controller|Namespace|application > Formats
Click to show internal directories.
Click to hide internal directories.