Skip to content

Instantly share code, notes, and snippets.

@jbueza
Created September 4, 2011 04:51
Show Gist options
  • Save jbueza/1192286 to your computer and use it in GitHub Desktop.
Save jbueza/1192286 to your computer and use it in GitHub Desktop.
mojo.require("app.extensions.SomeLibrary"); //I am against this as we should always
//package all extensions during deployment
/*
* @class Registration Controller
* @author Jaime Bueza
* @context #registration-form
*/
mojo.define("app.controller.RegistrationController", {
addObservers: function() {
},
addCommands: function() {
},
addIntercepts: function() {
}
});
mojo.define = function define(name, definition) {
//by convention, do not allow custom controllers inheriting from custom controllers
var mojoClassType = function(type) {
if ( type.match(/Controller/gi) ) return mojo.controller.Controller;
if ( type.match(/Command/gi) ) return mojo.command.Command;
if ( type.match(/Behavior/gi) ) return mojo.command.Behavior;
}(name);
mojo.provide(name);
mojo.declare(name, mojoClassType, definition);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment