mirror of
https://github.com/kataras/iris.git
synced 2025-12-19 10:57:05 +00:00
Add two examples for folder structuring as requested at https://github.com/kataras/iris/issues/748
Former-commit-id: 27c97d005d9cbd2309587b11fc9e2bab85870502
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
package follower
|
||||
|
||||
import (
|
||||
"github.com/kataras/iris"
|
||||
)
|
||||
|
||||
type Controller struct {
|
||||
iris.Controller
|
||||
}
|
||||
|
||||
func (c *Controller) GetBy(id int64) {
|
||||
c.Ctx.Writef("from "+c.Route().Path()+" with ID: %d", id)
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package following
|
||||
|
||||
import (
|
||||
"github.com/kataras/iris"
|
||||
)
|
||||
|
||||
type Controller struct {
|
||||
iris.Controller
|
||||
}
|
||||
|
||||
func (c *Controller) GetBy(id int64) {
|
||||
c.Ctx.Writef("from "+c.Route().Path()+" with ID: %d", id)
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package index
|
||||
|
||||
import (
|
||||
"github.com/kataras/iris"
|
||||
)
|
||||
|
||||
type Controller struct {
|
||||
iris.Controller
|
||||
}
|
||||
|
||||
func (c *Controller) Get() {
|
||||
c.Data["Title"] = "Index"
|
||||
c.Tmpl = "index.html"
|
||||
}
|
||||
13
_examples/structuring/mvc/app/controllers/like/controller.go
Normal file
13
_examples/structuring/mvc/app/controllers/like/controller.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package like
|
||||
|
||||
import (
|
||||
"github.com/kataras/iris"
|
||||
)
|
||||
|
||||
type Controller struct {
|
||||
iris.Controller
|
||||
}
|
||||
|
||||
func (c *Controller) GetBy(id int64) {
|
||||
c.Ctx.Writef("from "+c.Route().Path()+" with ID: %d", id)
|
||||
}
|
||||
Reference in New Issue
Block a user