Skip to content

sheercat/fillinform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fillinform

This is a golang port of HTML::FillInForm::Lite.

About 3 times slower than HTML::FillInForm::Lite.

installation

go get -u github.com/sheercat/fillinform

Usage

This product is alpha version yet.

use html/template

import (
   "github.com/sheercat/fillinform"
   "html/template"
)

...

writer := fillinform.FillWriter(w, fdat, nil)
html.ExecuteTemplate(writer, "layout", map[string]interface{}{"reqParams": reqParams})

use pongo2

import (
   "github.com/sheercat/fillinform"
   "github.com/flosch/pongo2"
)

....

bytes, err := tpl.ExecuteBytes(pongo2.Context{})
if err != nil {
   http.Error(w, err.Error(), http.StatusInternalServerError)
}

bytes, err = fillinform.Fill(bytes, formData.(map[string][]string), nil)
if err != nil {
   http.Error(w, err.Error(), http.StatusInternalServerError)
}

License

fillinform licensed under the MIT

About

port from html fillinform lite

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages