Skip to content

Instantly share code, notes, and snippets.

@steffen
Created February 8, 2011 21:45
Show Gist options
  • Save steffen/817324 to your computer and use it in GitHub Desktop.
Save steffen/817324 to your computer and use it in GitHub Desktop.
Ext.override(Ext.util.Route, {
constructor: function(config) {
Ext.apply(this, config, {
conditions: {}
});
/*
* The regular expression we use to match a segment of a route mapping
* this will recognise segments starting with a colon,
* e.g. on 'namespace/:controller/:action', :controller and :action will be recognised
*/
this.paramMatchingRegex = new RegExp(/:([0-9A-Za-z\_-]*)/g);
console.log('It's calling');
/*
* Converts a route string into an array of symbols starting with a colon. e.g.
* ":controller/:action/:id" => [':controller', ':action', ':id']
*/
this.paramsInMatchString = this.url.match(this.paramMatchingRegex) || [];
this.matcherRegex = this.createMatcherRegex(this.url);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment