-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
馃敟 template engines #129
Comments
Thanks for opening your first issue here! 馃帀 Be sure to follow the issue template! |
@mauricionr, we just released
Template rendering now our no.1 priority 馃憤, I will keep this issue open until we got more updates. |
The function uses the correct engine based on the file extension. func main() {
app := fiber.New()
app.Get("/", func(c *fiber.Ctx) {
data := map[string]interface{}{
"name": "John",
"age": "35",
}
var err error
//err = c.Render("views/test.template", data)
//err = c.Render("views/test.ace", data)
//err = c.Render("views/test.amber", data)
//err = c.Render("views/test.jet", data)
//err = c.Render("views/test.raymond", data)
err = c.Render("views/test.mustache", data)
if err != nil {
fmt.Println(err)
}
})
app.Listen(3000)
} |
json could be added as a template? like in phoenix 馃檲 馃 |
@mauricionr, feel free to suggest go template engines ( a link would be nice 馃槃 ) |
https://hexdocs.pm/phoenix/views.html#rendering-json sorry i forgot to put the link |
We only support Go engines for now, maybe we write our own in the far future. |
Is your feature request related to a problem?
No
Describe the solution you'd like
Template engines like in express
https://expressjs.com/en/guide/using-template-engines.html
Describe alternatives you've considered
No ideia
Additional context
Not only static files but also template engine to also support pass data to template and render it
The text was updated successfully, but these errors were encountered: