Renamed controllers package to routes.
This commit is contained in:
parent
60dedc0944
commit
869c507737
11 changed files with 12 additions and 12 deletions
22
routes/home.go
Normal file
22
routes/home.go
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
package routes
|
||||
|
||||
import (
|
||||
"goweb/controller"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
)
|
||||
|
||||
type Home struct {
|
||||
controller.Controller
|
||||
}
|
||||
|
||||
func (h *Home) Get(c echo.Context) error {
|
||||
p := controller.NewPage(c)
|
||||
p.Layout = "main"
|
||||
p.Name = "home"
|
||||
p.Data = "Hello world"
|
||||
p.Metatags.Description = "Welcome to the homepage."
|
||||
p.Metatags.Keywords = []string{"Go", "MVC", "Web", "Software"}
|
||||
|
||||
return h.RenderPage(c, p)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue