Reputation: 39
How do I make a part of the route(not just parameters) as optional? For example in:
\pid\:pid\did\:did
If did
is not present :did
should not be present.
How do I go about writing a route for this?
Upvotes: 0
Views: 39
Reputation: 858
As per your requirement, you have to create two end point.
/pid/:pid
/pid/:pid/did/:did
This will solve your problem.
Upvotes: 1