Documentation ¶
Index ¶
- func Add(name string, temp Template)
- func AddComp(comp Component)
- func AddFromPlugin(name string, mod string)
- func AddLoginComp(comp Component)
- func CSS(s string) template.CSS
- func DefaultFuncMap() template.FuncMap
- func Execute(tmpl *template.Template, tmplName string, user models.UserModel, ...) *bytes.Buffer
- func GetAsset(path string) ([]byte, error)
- func GetComponentAssetLists() []string
- func GetComponentAssetListsHTML() (res template.HTML)
- func GetComponentAssetListsWithinPage() []string
- func HTML(s string) template.HTML
- func JS(s string) template.JS
- func SetComp(name string, comp Component)
- type BaseComponent
- type Component
- type Template
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Add ¶ added in v0.0.2
Add 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.
func AddComp ¶ added in v0.0.2
func AddComp(comp Component)
AddComp makes a component available by the provided name. If Add is called twice with the same name or if component is nil, it panics.
func AddFromPlugin ¶ added in v1.0.3
func AddLoginComp ¶ added in v1.0.0
func AddLoginComp(comp Component)
AddLoginComp add the specified login component.
func DefaultFuncMap ¶ added in v1.0.0
func GetComponentAssetLists ¶ added in v1.0.6
func GetComponentAssetLists() []string
func GetComponentAssetListsHTML ¶ added in v1.0.6
func GetComponentAssetListsWithinPage ¶ added in v1.0.6
func GetComponentAssetListsWithinPage() []string
Types ¶
type BaseComponent ¶ added in v1.0.3
type BaseComponent struct{}
func (BaseComponent) GetAsset ¶ added in v1.0.3
func (b BaseComponent) GetAsset(name string) ([]byte, error)
func (BaseComponent) GetAssetList ¶ added in v1.0.3
func (b BaseComponent) GetAssetList() []string
type Component ¶ added in v0.0.2
type Component interface { // GetTemplate return a *template.Template and a given key. GetTemplate() (*template.Template, string) // GetAssetList return the assets url suffix used in the component. // example: // // {{.UrlPrefix}}/assets/login/css/bootstrap.min.css => login/css/bootstrap.min.css // // See: // https://github.com/GoAdminGroup/go-admin/blob/master/template/login/theme1.tmpl#L32 // https://github.com/GoAdminGroup/go-admin/blob/master/template/login/list.go GetAssetList() []string // GetAsset return the asset content according to the corresponding url suffix. // Asset content is recommended to use the tool go-bindata to generate. // // See: http://github.com/jteeuwen/go-bindata GetAsset(string) ([]byte, error) GetContent() template.HTML IsAPage() bool GetName() string }
Component is the interface which stand for a ui component.
type Template ¶ added in v0.0.2
type Template interface { // layout Col() types.ColAttribute Row() types.RowAttribute // form and table Form() types.FormAttribute Table() types.TableAttribute DataTable() types.DataTableAttribute Tree() types.TreeAttribute Tabs() types.TabsAttribute Alert() types.AlertAttribute Link() types.LinkAttribute Paginator() types.PaginatorAttribute Popup() types.PopupAttribute Box() types.BoxAttribute Label() types.LabelAttribute Image() types.ImgAttribute Button() types.ButtonAttribute // Builder methods GetTmplList() map[string]string GetAssetList() []string GetAsset(string) ([]byte, error) GetTemplate(bool) (*template.Template, string) }
Template is the interface which contains methods of ui components. It will be used in the plugins for custom the ui.
Click to show internal directories.
Click to hide internal directories.