func (f *Field) SetTmpl(tmpl string, style ...string) FieldInterface { f.tmpl = tmpl if f.tmpl != "" && f.Widget != nil { var s string if len(style) > 0 { s = style[0] } else { s = f.tmplStyle } f.Widget = widgets.BaseWidget(s, f.fieldType, f.tmpl) } return f }
// SetStyle sets the style (e.g.: BASE, BOOTSTRAP) of the field, correctly populating the Widget field. func (f *Field) SetStyle(style string) FieldInterface { f.tmplStyle = style f.Widget = widgets.BaseWidget(style, f.fieldType, f.tmpl) return f }