Skip to content

Latest commit

 

History

215 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gin

Doc Go Release Test Report Card Codecov License

Gin http driver for Goravel.

Install

Run the command below in your project to install the package automatically:

./artisan package:install github.com/goravel/gin

Or check the setup file to install the package manually.

Configuration

You can define the template configuration. If omitted, DefaultTemplate() is used automatically as a fallback, which loads views from resources/views and any registered package views.

You can provide a custom template configuration in two forms:

  • func() (render.HTMLRender, error) — a callback that returns a custom HTML renderer (e.g. to configure custom delimiters or a FuncMap).
  • render.HTMLRender — a pre-built renderer instance.

Custom example:

import (
    "html/template"

    "github.com/gin-gonic/gin/render"
    "github.com/goravel/gin"
)

"template": func() (render.HTMLRender, error) {
    return gin.NewTemplate(gin.RenderOptions{
        Delims:  &gin.Delims{Left: "{[", Right: "]}"},
        FuncMap: template.FuncMap{
            "upper": strings.ToUpper,
        },
    })
},

Testing

Run command below to run test:

go test ./...

About

The Gin driver for Route module of Goravel

Topics

Resources

Stars

12 stars

Watchers

2 watching

Forks

Releases

Used by

Contributors

Languages