1.

What Are “:params” And “*splats” In Dynamic Routing?

Answer»

Backbone uses two styles of variables when implementing routes:

  1. “:params” match any URL components between slashes. You can specify single fragment using “.params”
  2. “*splats” match any number of URL fragments after the query.
  3. 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.
  4. “*splats” or “:params” in route DEFINITIONS are passed as arguments (in respective order) to the associated function.
  5. A route defined as “/:route/:action” will PASS 2 variables (“route” and “action”) to the CALLBACK function.

Backbone uses two styles of variables when implementing routes:



Discussion

No Comment Found