O'Reilly logo

Better Backbone Applications with MarionetteJS by Joseph Zimmerman, Smashing Magazine

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 10: Controller

After talking about routers and assigning controllers to them, I bet you’re thinking that this chapter is about a Marionette component that is designed to be used as a controller for a router. Well, you’d be partially right. Let me explain by quoting the documentation:

A multi-purpose object to use as a controller for modules and routers, and as a mediator for workflow and coordination of other objects, views, and more.

It was intended to be a general-purpose controller to be used in your routers, but Derick’s favorite use is as a module controller. For each module he creates, he uses a Controller essentially as the API for that module. That’s a good use for it, but as you’ll see throughout this chapter, Controller is a lot ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required