Cleanup and additional template examples.

This commit is contained in:
mikestefanello 2021-12-24 23:31:43 -05:00
parent b4c4fae66b
commit cc2f25431b
4 changed files with 51 additions and 14 deletions

View file

@ -10,14 +10,14 @@ type About struct {
controller.Controller
}
func (a *About) Get(c echo.Context) error {
p := controller.NewPage(c)
p.Layout = "main"
p.Name = "about"
p.Title = "About"
p.Data = "This is the about page"
p.Cache.Enabled = false
p.Cache.Tags = []string{"page_about", "page:list"}
func (c *About) Get(ctx echo.Context) error {
page := controller.NewPage(ctx)
page.Layout = "main"
page.Name = "about"
page.Title = "About"
page.Data = "The data field can take in anything you want to send to the templates"
page.Cache.Enabled = false
page.Cache.Tags = []string{"page_about", "page:list"}
return a.RenderPage(c, p)
return c.RenderPage(ctx, page)
}