最简洁的答案是不。
长答案是controllers
,models
和configsviews
都stores
转换为requires
. 具有魔力的位在Ext.app.Controller类中:
onClassExtended: function(cls, data, hooks) {
var Controller = Ext.app.Controller,
className, namespace, onBeforeClassCreated, requires, proto, match;
className = Ext.getClassName(cls);
namespace = Ext.Loader.getPrefix(className) ||
((match = className.match(/^(.*)\.controller\./)) && match[1]);
if (namespace && namespace !== className) {
onBeforeClassCreated = hooks.onBeforeCreated;
requires = [];
hooks.onBeforeCreated = function(cls, data) {
proto = cls.prototype;
Controller.processDependencies(proto, requires, namespace, 'model', data.models);
Controller.processDependencies(proto, requires, namespace, 'view', data.views);
Controller.processDependencies(proto, requires, namespace, 'store', data.stores);
Controller.processDependencies(proto, requires, namespace, 'controller', data.controllers);
// this is the line to look at!!!
Ext.require(requires, Ext.Function.pass(onBeforeClassCreated, arguments, this));
};
}
},
您的应用程序只是一个Ext.app.Application
继承自的类Ext.app.Controller
;因此controllers
配置也转换为requires
.