diff --git a/ctx.go b/ctx.go index 789a5315ca..9d73c08bd4 100644 --- a/ctx.go +++ b/ctx.go @@ -1369,7 +1369,7 @@ func (c *DefaultCtx) GetRouteURL(routeName string, params Map) (string, error) { // Render a template with data and sends a text/html response. // We support the following engines: https://github.com/gofiber/template -func (c *DefaultCtx) Render(name string, bind Map, layouts ...string) error { +func (c *DefaultCtx) Render(name string, bind any, layouts ...string) error { // Get new buffer from pool buf := bytebufferpool.Get() defer bytebufferpool.Put(buf) diff --git a/ctx_interface_gen.go b/ctx_interface_gen.go index cc48576efb..cd93c48905 100644 --- a/ctx_interface_gen.go +++ b/ctx_interface_gen.go @@ -12,8 +12,7 @@ import ( "github.com/valyala/fasthttp" ) -// Ctx represents the Context which hold the HTTP request and response. -// It has methods for the request query string, parameters, body, HTTP headers and so on. +// Ctx represents the Context which hold the HTTP request and response.\nIt has methods for the request query string, parameters, body, HTTP headers and so on. type Ctx interface { // Accepts checks if the specified extensions or content types are acceptable. Accepts(offers ...string) string @@ -263,7 +262,7 @@ type Ctx interface { GetRouteURL(routeName string, params Map) (string, error) // Render a template with data and sends a text/html response. // We support the following engines: https://github.com/gofiber/template - Render(name string, bind Map, layouts ...string) error + Render(name string, bind any, layouts ...string) error renderExtensions(bind any) // Route returns the matched Route struct. Route() *Route diff --git a/docs/api/ctx.md b/docs/api/ctx.md index 85532a540d..b65532532a 100644 --- a/docs/api/ctx.md +++ b/docs/api/ctx.md @@ -1506,7 +1506,7 @@ app.Get("/teapot", func(c fiber.Ctx) error { Renders a view with data and sends a `text/html` response. By default, `Render` uses the default [**Go Template engine**](https://pkg.go.dev/html/template/). If you want to use another view engine, please take a look at our [**Template middleware**](https://docs.gofiber.io/template). ```go title="Signature" -func (c fiber.Ctx) Render(name string, bind Map, layouts ...string) error +func (c fiber.Ctx) Render(name string, bind any, layouts ...string) error ``` ## Request