Full demo
This commit is contained in:
@ -2,14 +2,21 @@ package handlers
|
||||
|
||||
import (
|
||||
"templ-tests/app/templates"
|
||||
"templ-tests/app/types"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func Home(c *gin.Context) {
|
||||
user := types.User{
|
||||
FirstName: "Pero",
|
||||
LastName: "Perić",
|
||||
}
|
||||
|
||||
pc := templates.PageContext{
|
||||
Title: "Welcome to the demo",
|
||||
ActivePage: "home",
|
||||
User: &user,
|
||||
}
|
||||
templates.Home(pc, "World").Render(c, c.Writer)
|
||||
templates.Home(pc).Render(c, c.Writer)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user