Skip to content

Latest commit

 

History

History
23 lines (18 loc) · 739 Bytes

path.md

File metadata and controls

23 lines (18 loc) · 739 Bytes

path method

FlowRouter.path(path, params, qs);
  • path {String} - Path or Route's name
  • params {Object} - Serialized route parameters, { _id: 'str' }
  • qs {Object} - Serialized query string, { key: 'val' }
  • Returns {String} - URI
const pathDef = '/blog/:cat/:id';
const params = { cat: 'met eor', id: 'abc' };
const queryParams = {show: 'y+e=s', color: 'black'};

const path = FlowRouter.path(pathDef, params, queryParams);
console.log(path); // --> "/blog/met%20eor/abc?show=y%2Be%3Ds&color=black"

If there are no params or qs, it will simply return the path as it is.

Further reading