I'm new to php and I'm using Slim Framework to develop a simple Rest Api.
According to docs, Slim uses FastRoute.
I have a route with optional params (vendor and quantity) like that:
path/items/{id}/{name}/{price}[/{vendor}[/{quantity}]]
The problem is that if I leave vendor blank the value of quantity goes to vendor and quantity will not be filled. I understand that with fast routes I can't achieve that. But, how can I do it?
- Can I do it with fast routes?
- Can I do it with Slim?
- Is there another framework that I can achieve what I want?
- Should I use only query strings? (I think that is the answer, but I need a help from someone with more knowledge).
Thank you.