• function

param can.route.param


Get a route path from given data.

can.route.param( data )


  1. object {data}

    The data to populate the route with.



The route, with the data populated in it.

Parameterizes the raw JS object representation provided in data.

can.route.param( { type: "video", id: 5 } ) 
     // -> "type=video&id=5"

If a route matching the provided data is found, that URL is built from the data. Any remaining data is added at the end of the URL as & separated key/value parameters.


can.route.param( { type: "video", id: 5 } ) // -> "video/5"
can.route.param( { type: "video", id: 5, isNew: false } ) 
     // -> "video/5&isNew=false"