Path Parameters

Learn to use path parameters to define flexible mappings.

Flexible mappings

Our controller has used a fixed, hardcoded path so far, but we can define flexible mappings as well. It will require a lot to take the id of something from the path in order to display information on that particular thing.

In our example, we could show more information about each team at /teams/<id> where <id> represents something unique about each team. We will use the entity’s primary key in many cases, but that does not necessarily have to be the case.

Get hands-on with 1400+ tech skills courses.