Skip to content

Commit

Permalink
Add docs from gofiber/fiber@9541a88
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Aug 30, 2024
1 parent f8df2bb commit f78d7e1
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions docs/core/guide/templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ app := fiber.New(fiber.Config{
})
```


### Supported Engines

The Fiber team maintains a [templates](https://docs.gofiber.io/template) package that provides wrappers for multiple template engines:
Expand All @@ -47,7 +46,6 @@ The Fiber team maintains a [templates](https://docs.gofiber.io/template) package
Custom template engines can implement the `Views` interface to be supported in Fiber.
:::


```go title="Views interface"
type Views interface {
// Fiber executes Load() on app initialization to load/parse the templates
Expand All @@ -63,7 +61,6 @@ type Views interface {
The `Render` method is linked to the [**ctx.Render\(\)**](../api/ctx.md#render) function that accepts a template name and binding data.
:::


## Rendering Templates

Once an engine is set up, a route handler can call the [**ctx.Render\(\)**](../api/ctx.md#render) function with a template name and binded data to send the rendered template.
Expand All @@ -76,9 +73,7 @@ func (c Ctx) Render(name string, bind Map, layouts ...string) error
By default, [**ctx.Render\(\)**](../api/ctx.md#render) searches for the template name in the `ViewsLayout` path. To override this setting, provide the path(s) in the `layouts` argument.
:::


<Tabs>

<TabItem value="example" label="Example">

```go
Expand Down Expand Up @@ -211,7 +206,7 @@ app.Get("/", func (c fiber.Ctx) error {
</TabItem>
</Tabs>

- For more advanced template documentation, please visit the [gofiber/template GitHub Repository](https://github.com/gofiber/template).
* For more advanced template documentation, please visit the [gofiber/template GitHub Repository](https://github.com/gofiber/template).

## Full Example

Expand Down

0 comments on commit f78d7e1

Please sign in to comment.