{"modulePath":"github.com/cppfuns/go-admin","version":"v0.0.2","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package template\n\n## Variables\n\n```go\nvar CompMap = map[string]Component{\n\t\"login\": login.GetLoginComponent(),\n}\n```\n\n## Functions\n\n```go\nfunc Add(name string, temp Template)\n```\nAdd makes a template available by the provided theme name. If Add is called twice with the same name or if template is nil, it panics.\n\n```go\nfunc AddComp(name string, comp Component)\n```\nAddComp makes a component available by the provided name. If Add is called twice with the same name or if component is nil, it panics.\n\n## Types\n\n```go\ntype Component interface {\n\tGetTemplate() (*template.Template, string)\n\tGetAssetList() []string\n\tGetAsset(string) ([]byte, error)\n}\n```\nComponent is the interface which stand for a ui component.\n\n```go\nfunc GetComp(name string) Component\n```\nGetComp gets the component by registered name. If the name is not found, it panics.\n\n```go\ntype Template interface {\n\t// Components\n\tForm() types.FormAttribute\n\tBox() types.BoxAttribute\n\tCol() types.ColAttribute\n\tImage() types.ImgAttribute\n\tSmallBox() types.SmallBoxAttribute\n\tLabel() types.LabelAttribute\n\tRow() types.RowAttribute\n\tTable() types.TableAttribute\n\tDataTable() types.DataTableAttribute\n\tTree() types.TreeAttribute\n\tInfoBox() types.InfoBoxAttribute\n\tPaginator() types.PaginatorAttribute\n\tAreaChart() types.AreaChartAttribute\n\tProgressGroup() types.ProgressGroupAttribute\n\tLineChart() types.LineChartAttribute\n\tBarChart() types.BarChartAttribute\n\tProductList() types.ProductListAttribute\n\tDescription() types.DescriptionAttribute\n\tAlert() types.AlertAttribute\n\tPieChart() types.PieChartAttribute\n\tChartLegend() types.ChartLegendAttribute\n\tTabs() types.TabsAttribute\n\n\t// Builder methods\n\tGetTmplList() map[string]string\n\tGetAssetList() []string\n\tGetAsset(string) ([]byte, error)\n\tGetTemplate(bool) (*template.Template, string)\n}\n```\nTemplate is the interface which contains methods of ui components. It will be used in the plugins for custom the ui.\n\n```go\nfunc Get(theme string) Template\n```\nGet the template interface by theme name. If the name is not found, it panics.\n\n","path":"github.com/cppfuns/go-admin/template","name":"template","synopsis":"","isRedistributable":true}
