完善
This commit is contained in:
parent
4e84bf21a0
commit
06e2f75000
|
@ -11,7 +11,7 @@ import (
|
||||||
|
|
||||||
var themeMap = map[string]func(int, *gin.Context, gin.H, int, int){}
|
var themeMap = map[string]func(int, *gin.Context, gin.H, int, int){}
|
||||||
|
|
||||||
func AddThemeHookFunc(name string, fn func(int, *gin.Context, gin.H, int, int)) {
|
func addThemeHookFunc(name string, fn func(int, *gin.Context, gin.H, int, int)) {
|
||||||
if _, ok := themeMap[name]; ok {
|
if _, ok := themeMap[name]; ok {
|
||||||
panic("exists same name theme")
|
panic("exists same name theme")
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ func FuncMap() template.FuncMap {
|
||||||
return comFn
|
return comFn
|
||||||
}
|
}
|
||||||
|
|
||||||
func AddTemplateFunc(fnName string, fn any) {
|
func addTemplateFunc(fnName string, fn any) {
|
||||||
if _, ok := comFn[fnName]; ok {
|
if _, ok := comFn[fnName]; ok {
|
||||||
panic("exists same name func")
|
panic("exists same name func")
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func InitThemeAndTemplateFuncMap() {
|
func InitThemeAndTemplateFuncMap() {
|
||||||
AddThemeHookFunc(twentyseventeen.ThemeName, twentyseventeen.Hook)
|
addThemeHookFunc(twentyseventeen.ThemeName, twentyseventeen.Hook)
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetTemplateName() string {
|
func GetTemplateName() string {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user