widgets

package
v0.0.0-...-fdf12c4 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2016 License: MIT Imports: 4 Imported by: 1

Documentation

Overview

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
}

Simple widget object that gets executed at render time.

func BaseWidget

func BaseWidget(style, inputType string) *Widget

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

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