mirror of
https://github.com/ZSCNetSupportDept/scheduler.git
synced 2025-10-29 04:55:04 +08:00
编写了模板注册部分
This commit is contained in:
16
templates/renderer.go
Normal file
16
templates/renderer.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package tl
|
||||
|
||||
import (
|
||||
"github.com/labstack/echo/v4"
|
||||
"html/template"
|
||||
"io"
|
||||
)
|
||||
|
||||
// template wrapper
|
||||
type tlw struct {
|
||||
Tl *template.Template
|
||||
}
|
||||
|
||||
func (t tlw) Render(w io.Writer, name string, data interface{}, c echo.Context) error {
|
||||
return t.Tl.ExecuteTemplate(w, name, data)
|
||||
}
|
||||
Reference in New Issue
Block a user