model

package
v0.3.11 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SelectItem

type SelectItem struct {
	Value    string
	Tag      string
	Selected bool
}

type SelectList

type SelectList struct {
	Name     string
	Multiple bool
	Filtered bool
	Items    []SelectItem
}

type ViewModel

type ViewModel struct {
	Model      interface{}
	Localizer  localizer.Localizer
	FormErrors map[string]string
	CsrfToken  string
	Ctx        *phx.Context
}

func CreateSelectListViewModel

func CreateSelectListViewModel(loc localizer.Localizer, name string, items []SelectItem, multiple bool) ViewModel

func CreateViewModel

func CreateViewModel(ctx *phx.Context, name string, model interface{}) ViewModel

func CreateYesNoSelectListViewModel

func CreateYesNoSelectListViewModel(loc localizer.Localizer, name string, value *bool) ViewModel

func (ViewModel) GetFormError

func (vm ViewModel) GetFormError(key string) string

func (ViewModel) HaveFormError

func (vm ViewModel) HaveFormError(key string) bool

func (ViewModel) Localize

func (vm ViewModel) Localize(key string) string

Jump to

Keyboard shortcuts

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