is there a way to specify a template for marionette region?
right now i’m using the layout object to specify a template.
AppLayout = Backbone.Marionette.Layout.extend({
template: tmpl
});
var layout = new AppLayout();
App.main.show(layout);
App.addRegions({
userInfo: "#userInfo",
mainMenu: "#mainMenu",
content: "#content"
});
App.mainMenu.show(new mainMenuView.Views.menu());
App.content.show(new dashboard.Views.main());
why i cannot get access directly from my app object to my regions, when i define them inside the layout object?
AppLayout = Backbone.Marionette.Layout.extend({
template: tmpl
regions: {
userInfo: "#userInfo",
mainMenu: "#mainMenu",
content: "#content"
}
});
var layout = new AppLayout();
App.main.show(layout);
does not work:
App.mainMenu.show(new mainMenuView.Views.menu());
App.content.show(new dashboard.Views.main());
Thanks
To access the regions of the layout you put in a region, you can write: