Renamed controllers package to routes.
This commit is contained in:
parent
60dedc0944
commit
869c507737
11 changed files with 12 additions and 12 deletions
27
routes/contact.go
Normal file
27
routes/contact.go
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
package routes
|
||||
|
||||
import (
|
||||
"goweb/controller"
|
||||
"goweb/msg"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
type Contact struct {
|
||||
controller.Controller
|
||||
}
|
||||
|
||||
func (a *Contact) Get(c echo.Context) error {
|
||||
p := controller.NewPage(c)
|
||||
p.Layout = "main"
|
||||
p.Name = "contact"
|
||||
p.Title = "Contact us"
|
||||
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.")
|
||||
return a.Redirect(c, "home")
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue