This document discusses YUI3 (Yahoo! User Interface Library 3). It describes how YUI3 uses combo loading to reduce the number of HTTP requests, how modules are added and used via the add() and use() methods, and how YUI3 implements object-oriented programming (OOP) principles. It also provides examples of how to define and load modules for a site application using YUI3 and PHP.
9. use
YUI.prototype.use = function() {
var Y = this, r = [],
args = Array.prototype.slice.call(arguments, 0),
callback = args[args.length - 1],
process = function(names) { ... };
args.pop();
process(args); // calculate sorted full module list r
Y._attach(r); // add the apis to Y
callback(Y);
return this;
};