widgets

package
v1.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 31, 2021 License: MIT Imports: 3 Imported by: 2

Documentation

Overview

Package widgets This package contains the base logic for the creation and rendering of field widgets. Base widgets are defined for most input fields, both in classic and Bootstrap3 style; custom widgets can be defined and associated to a field, provided that they implement the WidgetInterface interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Widget

type Widget struct {
	// contains filtered or unexported fields
}

Widget Simple widget object that gets executed at render time.

func BaseWidget

func BaseWidget(style, inputType, tmplName string) *Widget

BaseWidget creates a Widget based on style and inpuType parameters, both defined in the common package.

func New added in v1.7.2

func New(t *template.Template) *Widget

func (*Widget) Render

func (w *Widget) Render(data interface{}) string

Render executes the internal template and returns the result as a template.HTML object.

type WidgetInterface

type WidgetInterface interface {
	Render(data interface{}) string
}

WidgetInterface defines the requirements for custom widgets.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL