Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

License

NotificationsYou must be signed in to change notification settings

ngerakines/ginpongo2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Thegithub.com/ngerakines/ginpongo2 package provides a middleware that can be used to render pongo2 templates.

Example

To use this, first ensure that the middleware is being referenced by gin usingUse. Then inide of your handler, use the contextSet methods to set the "template" and "data" variables.

package mainimport ("github.com/gin-gonic/gin""github.com/ngerakines/ginpongo2""log")funcmain() {r:=gin.Default()r.Use(ginpongo2.Pongo2())r.GET("/",func(c*gin.Context) {c.Set("template","index.html")c.Set("data",map[string]interface{}{"message":"Hello World!"})})e:=r.Run(":8080")}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp