1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-18 02:17:05 +00:00

fix _benchmarks/iris-mvc-templates

Former-commit-id: 10b4952308c62b81eb7270b9e0b29ad0bb645bc5
This commit is contained in:
Gerasimos (Makis) Maropoulos
2017-12-31 20:33:33 +02:00
parent 4dbecf762c
commit 9e6691e5ce
6 changed files with 53 additions and 49 deletions

View File

@@ -2,10 +2,16 @@ package controllers
import "github.com/kataras/iris/mvc"
type AboutController struct{ mvc.Controller }
type AboutController struct{}
func (c *AboutController) Get() {
c.Data["Title"] = "About"
c.Data["Message"] = "Your application description page."
c.Tmpl = "about.html"
var aboutView = mvc.View{
Name: "about.html",
Data: map[string]interface{}{
"Title": "About",
"Message": "Your application description page..",
},
}
func (c *AboutController) Get() mvc.View {
return aboutView
}

View File

@@ -2,10 +2,16 @@ package controllers
import "github.com/kataras/iris/mvc"
type ContactController struct{ mvc.Controller }
type ContactController struct{}
func (c *ContactController) Get() {
c.Data["Title"] = "Contact"
c.Data["Message"] = "Your contact page."
c.Tmpl = "contact.html"
var contactView = mvc.View{
Name: "contact.html",
Data: map[string]interface{}{
"Title": "Contact",
"Message": "Your contact page.",
},
}
func (c *ContactController) Get() mvc.View {
return contactView
}

View File

@@ -2,9 +2,13 @@ package controllers
import "github.com/kataras/iris/mvc"
type IndexController struct{ mvc.Controller }
type IndexController struct{}
func (c *IndexController) Get() {
c.Data["Title"] = "Home Page"
c.Tmpl = "index.html"
var indexView = mvc.View{
Name: "index.html",
Data: map[string]interface{}{"Title": "Home Page"},
}
func (c *IndexController) Get() mvc.View {
return indexView
}

View File

@@ -1,16 +0,0 @@
package controllers
import "github.com/kataras/iris/mvc"
type IndexControllerStatic struct{ mvc.C }
var index = mvc.View{
Name: "index.html",
Data: map[string]interface{}{
"Title": "Home Page",
},
}
func (c *IndexControllerStatic) Get() mvc.View {
return index
}