https://github.com/ipfans/echo-pongo2
Package moves to https://github.com/echo-contrib/pongor. Package echo-pongo2 is a middleware that provides pongo2 template engine support for echo.
https://github.com/ipfans/echo-pongo2
Last synced: 11 months ago
JSON representation
Package moves to https://github.com/echo-contrib/pongor. Package echo-pongo2 is a middleware that provides pongo2 template engine support for echo.
- Host: GitHub
- URL: https://github.com/ipfans/echo-pongo2
- Owner: ipfans
- License: apache-2.0
- Created: 2015-08-04T09:46:35.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2017-07-03T02:38:02.000Z (about 9 years ago)
- Last Synced: 2025-01-31T10:11:25.471Z (over 1 year ago)
- Language: Go
- Homepage: https://github.com/echo-contrib/pongor
- Size: 107 KB
- Stars: 2
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
echo-pongo2
======
Middleware echo-pongo2 is a [pongo2](https://github.com/flosch/pongo2) template engine support for [echo](https://github.com/labstack/echo/).
### Installation
go get github.com/ipfans/echo-pongo2
## Example
```go
package main
import (
"github.com/ipfans/echo-pongo2"
"github.com/labstack/echo"
"github.com/labstack/echo/middleware"
)
func main() {
serv := echo.New()
serv.Use(middleware.Logger())
serv.Use(middleware.Recover())
serv.Use(pongo2.Pongo2())
serv.Get("/", func(ctx *echo.Context) error {
// ctx.Set("ContentType") = "text/html"
// ctx.Set("encoding") = "UTF-8"
ctx.Set("template", "index.html")
ctx.Set("data", map[string]interface{}{
"user": "ipfans",
})
return nil
})
serv.Run("127.0.0.1:8080")
}
```
## License
This project is under Apache v2 License. See the [LICENSE](LICENSE) file for the full license text.