optional parameters #9150
-
Hi all,
the page goes in 404 if it is not present or if its value is not exactly "spacial_id" (so it is not a dynamic value). why? thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
If a value is missing, it'll just be filtered out of the route. For example if you have a route like this: Is |
Beta Was this translation helpful? Give feedback.
-
thanks for the prompt reply it is not a real field, it is just a value that I have to pass via url and that I'll need to use in the view model. and then I would use the 3455 (in the view model, like I would do in a normal laravel controller via normal laravel routing) to query a model and get a records (for example) to do something specific to be returned to a view. How should I define these cases with the route param in the yaml file of a collection? |
Beta Was this translation helpful? Give feedback.
If a value is missing, it'll just be filtered out of the route.
For example if you have a route like this:
page/{slug}/{special_id}
And an entry with a special_id, its url would be:
page/my-slug/my-special-id
An entry without a special it, its url would be
page/my-slug
Is
special_id
a real field or are you defining it in the view model?