saasitone/controllers/contact.go

27 lines
483 B
Go
Raw Normal View History

2021-12-03 03:11:01 -08:00
package controllers
import (
"goweb/msg"
"github.com/labstack/echo/v4"
)
type Contact struct {
Controller
}
func (a *Contact) Get(c echo.Context) error {
p := NewPage(c)
p.Layout = "main"
p.Name = "contact"
2021-12-03 05:49:07 -08:00
p.Title = "Contact us"
2021-12-03 03:11:01 -08:00
p.Data = "This is the contact page"
return a.RenderPage(c, p)
}
func (a *Contact) Post(c echo.Context) error {
msg.Success(c, "Thank you for contacting us!")
msg.Info(c, "We will respond to you shortly.")
2021-12-03 03:11:01 -08:00
return a.Redirect(c, "home")
}