mirror of
https://github.com/kataras/iris.git
synced 2025-12-18 10:27:06 +00:00
fix all _examples to the newest mvc, add comments to those examples and add a package-level .Configure in order to make it easier for new users. Add a deprecated panic if app.Controller is used with a small tutorial and future resource link so they can re-write their mvc app's definitions
Former-commit-id: bf07696041be9e3d178ce3c42ccec2df4bfdb2af
This commit is contained in:
@@ -17,13 +17,13 @@ type TodoController struct {
|
||||
}
|
||||
|
||||
// BeforeActivation called once before the server ran, and before
|
||||
// the routes and dependency binder builded.
|
||||
// the routes and dependencies binded.
|
||||
// You can bind custom things to the controller, add new methods, add middleware,
|
||||
// add dependencies to the struct or the method(s) and more.
|
||||
func (c *TodoController) BeforeActivation(ca *mvc.ControllerActivator) {
|
||||
func (c *TodoController) BeforeActivation(b mvc.BeforeActivation) {
|
||||
// this could be binded to a controller's function input argument
|
||||
// if any, or struct field if any:
|
||||
ca.Dependencies.Add(func(ctx iris.Context) todo.Item {
|
||||
b.Dependencies().Add(func(ctx iris.Context) todo.Item {
|
||||
// ctx.ReadForm(&item)
|
||||
var (
|
||||
owner = ctx.PostValue("owner")
|
||||
|
||||
Reference in New Issue
Block a user