Created
March 7, 2013 20:20
-
-
Save rezoner/5111476 to your computer and use it in GitHub Desktop.
Page flow controllers examples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* example Kohana/CodeIgniter like controller */ | |
module.exports = { | |
default: function(args, callback) { | |
}, | |
article: function(args, callback) { | |
}, | |
gallery: function(args, callback) { | |
} | |
} | |
/* minimalistic controller */ | |
module.exports = function(args, callback) { | |
switch(args[0]) { | |
case article: | |
break; | |
case gallery: | |
break; | |
default: | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment