Initial commit.
This commit is contained in:
commit
63f43e568c
23 changed files with 1199 additions and 0 deletions
25
controllers/contact.go
Normal file
25
controllers/contact.go
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
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"
|
||||
p.Data = "This is the contact page"
|
||||
return a.RenderPage(c, p)
|
||||
}
|
||||
|
||||
func (a *Contact) Post(c echo.Context) error {
|
||||
msg.Set(c, msg.Success, "Thank you for contacting us!")
|
||||
msg.Set(c, msg.Info, "We will respond to you shortly.")
|
||||
return a.Redirect(c, "home")
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue