What are “:params” and “*splats” in Dynamic Routing?


Please explain why do you think this question should be reported?

Report Cancel

Backbone uses two styles of variables when implementing routes:“:params” match any URL components between slashes. You can specify single fragment using “.params”“*splats” match any number of URL fragments after the query.
Note that due to the nature of a “*splat”, it will always be the last variable in your URL as it will match any and all components.“*splats” or “:params” in route definitions are passed as arguments (in respective order) to the associated function.A route defined as “/:route/:action” will pass 2 variables (“route” and “action”) to the callback function.

Please follow and like us:

About the Author