Skip to content

Instantly share code, notes, and snippets.

@rmdort
Created December 19, 2010 18:36
Show Gist options
  • Save rmdort/747574 to your computer and use it in GitHub Desktop.
Save rmdort/747574 to your computer and use it in GitHub Desktop.
Sammy.js Routes for Expression Engine
// Sammy Routes for Expression Engine
this.get('#/', function(context) {
this.partial('{path=sammy/home}');
context.app.swap();
});
this.get('#!/:url', function(context) {
this.partial('{path=sammy}/'+this.params['url']);
});
this.get('#!/:url/:item', function(context) {
context.partial('{path=sammy}/'+context.params['url']);
});
this.get('#!/:url/category/:item', function(context) {
this.partial('{path=sammy}/'+context.params['url']+'/category/'+context.params['item']);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment