XF 2.2 How to not require route format

AndrewSimm

Well-known member
I am working on an add-on that will have six filters. Is it possible to create a route format that doesn't require these fields but allows all of them to be used? Basically I am just trying to figure out how to get these values into $params so I don't have to use and clean $_GET.

1641149320049.webp
 
The parameters should already be optional, though they are still positional. For example, in your case you couldn't have a year_id without a sport_id, or a position_id without both a sport_id and year_id.
 
The parameters should already be optional, though they are still positional. For example, in your case you couldn't have a year_id without a sport_id, or a position_id without both a sport_id and year_id.
Is there a better way to essentially use a $_GET super global?
 
What you posted should work fine if you wanted to use route parameters. If you want to get input from the request (whether GET or POST), use the filter method on the controller.
 
What you posted should work fine if you wanted to use route parameters. If you want to get input from the request (whether GET or POST), use the filter method on the controller.
Oh man, not sure why I thought that method was only for POST. This makes much more sense now.
 
Back
Top Bottom