Skip to content

Package template is a middleware that provides Go template rendering for Flamego

License

Notifications You must be signed in to change notification settings

flamego/template

Repository files navigation

template

GitHub Workflow StatusGoDoc

Package template is a middleware that provides Go template rendering for Flamego.

Installation

go get github.com/flamego/template

Getting started

<!-- templates/home.tmpl --><p> Hello, <b>{{.Name}}</b>! </p>
package main import ( "net/http""github.com/flamego/flamego""github.com/flamego/template" ) funcmain(){f:=flamego.Classic() f.Use(template.Templater()) f.Get("/", func(t template.Template, data template.Data){data["Name"] ="Joe"t.HTML(http.StatusOK, "home") }) f.Run() }

Getting help

License

This project is under the MIT License. See the LICENSE file for the full license text.

About

Package template is a middleware that provides Go template rendering for Flamego

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages