web/templates.go
2018-05-16 23:01:06 -04:00

18 lines
379 B
Go

package main
import (
"html/template"
"io"
"github.com/labstack/echo"
)
// Template implements echo.Renderer
type Template struct {
templates *template.Template
}
// Render executes the selected template with the given data
func (t *Template) Render(w io.Writer, name string, data interface{}, c echo.Context) error {
return t.templates.ExecuteTemplate(w, name, data)
}