Custom css SAS & layout playground

This commit is contained in:
Sas Andy
2024-04-25 16:56:20 +07:00
parent 34be7a29a1
commit da95e5b89f
13 changed files with 5213 additions and 7 deletions

View File

@@ -7,6 +7,13 @@ func SetupRoutes(app *echo.Echo, h *UserHandler) {
group.GET("", h.HandlerShowUsers)
group.GET("/details/:id", h.HandlerShowUserById)
}
//PLAYGROUND TESTING
func SetupRoutesXsample(app *echo.Echo, h *XsampleHandler) {
xSample := app.Group("/xsample")
xSample.GET("/xsample01", h.Hello)
}
func SetupRoutesProject(app *echo.Echo) {

View File

@@ -0,0 +1,32 @@
package handlers
import (
"github.com/a-h/templ"
"github.com/emarifer/go-templ-project-structure/views/xsample"
"github.com/labstack/echo/v4"
)
type XsampleService interface {
}
func NewXsampleHandler(us XsampleService) *XsampleHandler {
return &XsampleHandler{
XsampleService: us,
}
}
type XsampleHandler struct {
XsampleService XsampleService
}
func (uh *XsampleHandler) Hello(c echo.Context) error {
helo := xsample.ShowHelo("Hello World", xsample.HelloWorld("Hello World"), xsample.CssHelo(), xsample.JsHelo())
return uh.View(c, helo)
}
func (uh *XsampleHandler) View(c echo.Context, cmp templ.Component) error {
c.Response().Header().Set(echo.HeaderContentType, echo.MIMETextHTML)
return cmp.Render(c.Request().Context(), c.Response().Writer)
}