1
0
mirror of https://github.com/kataras/iris.git synced 2026-01-05 11:17:03 +00:00

remove old deprecated code from previous version, no need to keep backward compatibility, it was two months ago v10.0.0 released so we should be ok now

Former-commit-id: 81ac9d4913e78154b4bb74a01ce707b510e674ec
This commit is contained in:
Gerasimos (Makis) Maropoulos
2018-02-12 06:03:15 +02:00
parent 7fd8baea75
commit fce7959424
5 changed files with 5 additions and 240 deletions

View File

@@ -1,55 +1 @@
package iris
import (
"fmt"
"github.com/kataras/iris/core/router"
"github.com/kataras/iris/mvc"
)
// Controller method is DEPRECATED, use the "mvc" subpackage instead, i.e
// import "github.com/kataras/iris/mvc" and read its docs among with its new features at:
// https://github.com/kataras/iris/blob/master/HISTORY.md#mo-01-jenuary-2018--v1000
func (app *Application) Controller(relPath string, c interface{}, _ ...interface{}) []*router.Route {
name := mvc.NameOf(c)
panic(fmt.Errorf(`"Controller" method is DEPRECATED, use the "mvc" subpackage instead.
PREVIOUSLY YOU USED TO CODE IT LIKE THIS:
import (
"github.com/kataras/iris"
// ...
)
app.Controller("%s", new(%s), Struct_Values_Binded_To_The_Fields_Or_And_Any_Middleware)
NOW YOU SHOULD CODE IT LIKE THIS:
import (
"github.com/kataras/iris"
"github.com/kataras/iris/mvc"
// ...
)
// or use it like this: ).Register(...).Handle(new(%s))
mvc.Configure(app.Party("%s"), myMVC)
func myMVC(mvcApp *mvc.Application) {
mvcApp.Register(
Struct_Values_Dependencies_Binded_To_The_Fields_Or_And_To_Methods,
Or_And_Func_Values_Dependencies_Binded_To_The_Fields_Or_And_To_Methods,
)
mvcApp.Router.Use(Any_Middleware)
mvcApp.Handle(new(%s))
}
The new MVC implementation contains a lot more than the above,
this is the reason you see more lines for a simple controller.
Please read more about the newest, amazing, features by navigating below
https://github.com/kataras/iris/blob/master/HISTORY.md#mo-01-jenuary-2018--v1000`, // v10.0.0, we skip the number 9.
relPath, name, name, relPath, name))
}