Documentation
¶
Index ¶
- type FormField
- type FormHandler
- func (h *FormHandler) HandleForm(w http.ResponseWriter, r *http.Request)
- func (h *FormHandler) ListTemplates(w http.ResponseWriter, r *http.Request)
- func (h *FormHandler) RegisterFormRoutes(mux *http.ServeMux)
- func (h *FormHandler) RenderField(f FormField) string
- func (h *FormHandler) ServeFormPage(w http.ResponseWriter, r *http.Request)
- func (h *FormHandler) ServeFormScript(w http.ResponseWriter, r *http.Request)
- type TemplateDef
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FormField ¶
type FormField struct {
ID string `json:"id"`
// Input fields
Name string `json:"name"`
Label string `json:"label"`
Type string `json:"type"`
Required bool `json:"required"`
Options []string `json:"options"`
Placeholder string `json:"placeholder"`
Help string `json:"help"`
NumberKind string `json:"number_kind"`
Render string `json:"render"`
VerifyEmail bool `json:"verify_email"`
RejectIfInvalid bool `json:"reject_if_invalid"`
Min float64 `json:"min"`
Max float64 `json:"max"`
Step float64 `json:"step"`
StartLabel string `json:"start_label"`
EndLabel string `json:"end_label"`
// Layout metadata
Section string `json:"section"`
Width string `json:"width"` // auto | half | full
// Layout-only content
Content string `json:"content"` // for heading/text_block
Level int `json:"level"` // 1..3 for heading
}
type FormHandler ¶
func NewFormHandler ¶
func NewFormHandler(h *handlers.Handler) *FormHandler
func (*FormHandler) HandleForm ¶
func (h *FormHandler) HandleForm(w http.ResponseWriter, r *http.Request)
func (*FormHandler) ListTemplates ¶
func (h *FormHandler) ListTemplates(w http.ResponseWriter, r *http.Request)
func (*FormHandler) RegisterFormRoutes ¶
func (h *FormHandler) RegisterFormRoutes(mux *http.ServeMux)
HandleForm receives form submissions (JSON, x-www-form-urlencoded, or multipart)
func (*FormHandler) RenderField ¶
func (h *FormHandler) RenderField(f FormField) string
func (*FormHandler) ServeFormPage ¶
func (h *FormHandler) ServeFormPage(w http.ResponseWriter, r *http.Request)
ServeFormPage renders a public HTML form for a configured form source path.
func (*FormHandler) ServeFormScript ¶
func (h *FormHandler) ServeFormScript(w http.ResponseWriter, r *http.Request)
ServeFormScript returns a small JS snippet to embed a form.
Click to show internal directories.
Click to hide internal directories.