示例#1
0
文件: form.go 项目: rainycape/gondola
func (r *FormRenderer) WriteHelp(w io.Writer, field *form.Field, help string) error {
	span := html.Span(html.Text(help))
	span.Attrs = html.Attrs{"class": "help-block"}
	_, err := span.WriteTo(w)
	return err
}
示例#2
0
文件: form.go 项目: rainycape/gondola
func (r *FormRenderer) WriteError(w io.Writer, field *form.Field, err error) error {
	span := html.Span(html.Text(err.Error()))
	span.Attrs = html.Attrs{"class": "help-block"}
	_, werr := span.WriteTo(w)
	return werr
}