github.com/kotovmak/go-admin@v1.1.1/template/components/label.go (about) 1 package components 2 3 import ( 4 "html/template" 5 6 "github.com/kotovmak/go-admin/template/types" 7 ) 8 9 type LabelAttribute struct { 10 Name string 11 Color template.HTML 12 Type string 13 Content template.HTML 14 types.Attribute 15 } 16 17 func (compo *LabelAttribute) SetType(value string) types.LabelAttribute { 18 compo.Type = value 19 return compo 20 } 21 22 func (compo *LabelAttribute) SetColor(value template.HTML) types.LabelAttribute { 23 compo.Color = value 24 return compo 25 } 26 27 func (compo *LabelAttribute) SetContent(value template.HTML) types.LabelAttribute { 28 compo.Content = value 29 return compo 30 } 31 32 func (compo *LabelAttribute) GetContent() template.HTML { 33 return ComposeHtml(compo.TemplateList, compo.Separation, *compo, "label") 34 }