forked from GoAdminGroup/go-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
form.go
59 lines (49 loc) · 1.3 KB
/
form.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package components
import (
"github.com/chenhg5/go-admin/template/types"
"html/template"
)
type FormAttribute struct {
Name string
Content []types.FormStruct
Url string
Method string
InfoUrl string
CSRFToken string
Title string
Prefix string
}
func (compo *FormAttribute) SetContent(value []types.FormStruct) types.FormAttribute {
compo.Content = value
return compo
}
func (compo *FormAttribute) SetPrefix(value string) types.FormAttribute {
compo.Prefix = value
return compo
}
func (compo *FormAttribute) SetUrl(value string) types.FormAttribute {
compo.Url = value
return compo
}
func (compo *FormAttribute) SetInfoUrl(value string) types.FormAttribute {
compo.InfoUrl = value
return compo
}
func (compo *FormAttribute) SetMethod(value string) types.FormAttribute {
compo.Method = value
return compo
}
func (compo *FormAttribute) SetTitle(value string) types.FormAttribute {
compo.Title = value
return compo
}
func (compo *FormAttribute) SetToken(value string) types.FormAttribute {
compo.CSRFToken = value
return compo
}
func (compo *FormAttribute) GetContent() template.HTML {
return ComposeHtml(*compo, "form",
"form/default", "form/file", "form/textarea",
"form/selectbox", "form/text",
"form/password", "form/select", "form/singleselect", "form/iconpicker")
}