mirror of
https://github.com/kataras/iris.git
synced 2025-12-19 10:57:05 +00:00
ok the new mvc system works great, all tests done and almost x3 smaller LOC used plus new three awesome features:) - next commit will be commenting out and replace the mvc package with the new mvc2
Former-commit-id: 552095d29256a1116849cc6054c82001e790e705
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
package mvc2
|
||||
|
||||
import (
|
||||
"github.com/kataras/iris/context"
|
||||
"github.com/kataras/iris/sessions"
|
||||
"reflect"
|
||||
|
||||
"github.com/kataras/golog"
|
||||
"github.com/kataras/iris/context"
|
||||
"github.com/kataras/iris/sessions"
|
||||
)
|
||||
|
||||
var defaultManager = sessions.New(sessions.Config{})
|
||||
@@ -25,8 +25,8 @@ type SessionController struct {
|
||||
// It makes sure that its "Manager" field is filled
|
||||
// even if the caller didn't provide any sessions manager via the `app.Controller` function.
|
||||
func (s *SessionController) OnActivate(ca *ControllerActivator) {
|
||||
if !ca.Engine.BindTypeExists(reflect.TypeOf(defaultManager)) {
|
||||
ca.Engine.Bind(defaultManager)
|
||||
if !ca.BindTypeExists(reflect.TypeOf(defaultManager)) {
|
||||
ca.Bind(defaultManager)
|
||||
golog.Warnf(`MVC SessionController: couldn't find any "*sessions.Sessions" bindable value to fill the "Manager" field,
|
||||
therefore this controller is using the default sessions manager instead.
|
||||
Please refer to the documentation to learn how you can provide the session manager`)
|
||||
|
||||
Reference in New Issue
Block a user