godash/templates.go
2023-04-16 21:44:54 +02:00

16 lines
309 B
Go

package main
import (
"html/template"
"io"
"github.com/labstack/echo/v4"
)
type TemplateRenderer struct {
templates *template.Template
}
func (t *TemplateRenderer) Render(w io.Writer, name string, data interface{}, c echo.Context) error {
return t.templates.ExecuteTemplate(w, "layout.html", data)
}