1
0
Fork 0
forked from goffee/cup
cup/controllers/sample.go

31 lines
677 B
Go
Raw Permalink Normal View History

2024-09-30 10:17:24 -04:00
// Copyright (c) 2024 Zeni Kim <zenik@smarteching.com>
// Use of this source code is governed by MIT-style
// license that can be found in the LICENSE file.
package controllers
import (
"git.smarteching.com/goffee/core"
"git.smarteching.com/goffee/core/template/components"
)
// Show basic template
func Sample(c *core.Context) *core.Response {
2024-10-07 19:12:28 -04:00
// first, include all compoments
2024-09-30 10:17:24 -04:00
type templateData struct {
2024-10-07 19:12:28 -04:00
PageCard components.PageCard
2024-09-30 10:17:24 -04:00
}
2024-10-07 19:12:28 -04:00
// now fill data of the components
2024-09-30 10:17:24 -04:00
tmplData := templateData{
2024-10-07 19:12:28 -04:00
PageCard: components.PageCard{
CardTitle: "Framework Goffee",
CardBody: "Powered by Golang",
2024-09-30 10:17:24 -04:00
},
}
return c.Response.Template("basic.html", tmplData)
}