function(name, profileName) {
        var instances = this.getControllerInstances(),
            appName   = this.getName(),
            format    = Ext.String.format,
            topLevelName;

        if (name instanceof Ext.app.Controller) {
            return name;
        }

        if (instances[name]) {
            return instances[name];
        } else {
            topLevelName = format("{0}.controller.{1}", appName, name);
            profileName  = format("{0}.controller.{1}.{2}", appName, profileName, name);

            return instances[profileName] || instances[topLevelName];
        }
    }
function(name, profileName) {
        var instances = this.getControllerInstances(),
            appName   = this.getName(),
            format    = Ext.String.format,
            topLevelName;

        if (name instanceof Ext.app.Controller) {
            return name;
        }

        if (instances[name]) {
            return instances[name];
        } else {
            topLevelName = format("{0}.controller.{1}", appName, name);
            profileName  = format("{0}.controller.{1}.{2}", appName, profileName, name);

            return instances[profileName] || instances[topLevelName];
        }
    }
function ( name , profileName ) { var instances = this . getControllerInstances ( ) , appName = this . getName ( ) , format = Ext . String . format , topLevelName ; if ( name instanceof Ext . app . Controller ) { return name ; } if ( instances [ name ] ) { return instances [ name ] ; } else { topLevelName = format ( "{0}.controller.{1}" , appName , name ) ; profileName = format ( "{0}.controller.{1}.{2}" , appName , profileName , name ) ; return instances [ profileName ] || instances [ topLevelName ] ; } }
Returns the Controller instance for the given controller name.
@param {String} name The name of the Controller.
@param {String} [profileName] Optional profile name. If passed, this is the same as calling
`getController('profileName.controllerName')`.
@return {Ext.app.Controller} controller instance or undefined.
Returns the Controller instance for the given controller name .