In early version Marionette we could use Marionette Controller
return Marionette.AppRouter.extend({
appRoutes: {
'admin/:controller/:action(?:query)': "controllerThird",
'*notFound': "error"
},
controller: new Controller()
})
return Marionette.Controller.extend ({
controllerThird: function (controller, action, query) {
this.start(action);
}
})
but now Marionette.Controller
Warning: deprecated. The Controller object is deprecated. Instead of using the Controller class with the AppRouter, you should specify your callbacks on a plain Javascript object or a Marionette Object
We use MVC controller like
function (Backbone, Marionette, controller){
"use strict";
var AppRouter = Backbone.Marionette.AppRouter.extend({
appRoutes: {
"path1" : "goto_path1",
"path2" : "goto_path2",
"path3" : "goto_path3"
}
});
return new AppRouter({controller: controller});
});
define([
'jquery',
'underscore',
'backbone',
'marionette',
'app',
'userSession'
],
function($, _, Backbone, Marionette, App, userSession) {
return {
goto_path1: function () {
//I need get current query in this point
},
});
In Controller handler I want access to action, query params like
controllerThird: function (controller, action, query)
How can I do this ?