code: function generateControllerFactory(container, controllerName, context) {
        var Factory, fullName, instance, name, factoryName, controllerType;
  
        if (context && isArray(context)) {
          controllerType = 'array';
        } else if (context) {
          controllerType = 'object';
        } else {
          controllerType = 'basic';
        }
  
        factoryName = 'controller:' + controllerType;
  
        Factory = container.lookupFactory(factoryName).extend({
          isGenerated: true,
          toString: function() {
            return "(generated " + controllerName + " controller)";
          }
        });
  
        fullName = 'controller:' + controllerName;
  
        container.register(fullName,  Factory);
  
        return Factory;
      }
docs: @module ember
  @submodule ember-routing
   
  Generates a controller factory
  
  The type of the generated controller factory is derived
  from the context. If the context is an array an array controller
  is generated, if an object, an object controller otherwise, a basic
  controller is generated.
  
  You can customize your generated controllers by defining
  `App.ObjectController` or `App.ArrayController`.
  
  @for Ember
  @method generateControllerFactory
  @private