javascript - optional parameter in flatiron/director -
javascript - optional parameter in flatiron/director -
is possibile create route optional parameter in flatiron/director?
var router = router({ 'order' : function(){ // create order }, 'order/:orderid' : function(orderid){ // load order id } }).init();
can utilize 1 single route manage edit/load order?
from director docs:
var router = router({ // // given route '/hello/world/johny/appleseed'. // '/hello': { '/world/?([^\/]*)\/([^\/]*)/?': function (a, b) { console.log(a, b); } } });
basically utilize regex instead of simple :tokens
johny
, appleseed
become optional parameters.
javascript routing flatiron.js
Comments
Post a Comment