Created
February 18, 2012 11:33
-
-
Save datiecher/1858921 to your computer and use it in GitHub Desktop.
loadUrl version that removes a php front controller from the url
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
Backbone.history.loadUrl = function(fragmentOverride) { | |
var fragment = this.fragment = this.getFragment(fragmentOverride).replace(/^.+\.php\/?/, ''); | |
var matched = _.any(this.handlers, function(handler) { | |
if (handler.route.test(fragment)) { | |
handler.callback(fragment); | |
return true; | |
} | |
}); | |
return matched; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment