Chaplin.Dispatcher → Source

The Dispatcher sits between the router and the various controllers of your application. It listens for a routing event to occur and then:

  • disposes the previously active controller,
  • loads the target controller module,
  • instantiates the new controller, and
  • calls the target action.

Methods

initialize([options={}])

  • options:
    • controllerPath (default '/controllers'): the path to the folder for the controllers.
    • controllerSuffix (default '_controller':) the suffix used for controller files. Both of these options serve to generate path names for autoloading controller modules.