So, here's the deal, I'm creating a webpage within Moodle to display some external data, and I want to allow users to filter through this data using a multi-filter like so:
The problem is, upon submitting this form, the GET request generated uses the URL */?category=3D+%26+Animation&category=Accounting&category=Agile+%26+Scrum , ie, the category param is used multiple times. I'm trying to parse all of these within my php code, but I'm having trouble even capturing the values correctly. I know about optional_param_array, and I'm trying to use it as below
$categoryFilter = optional_param_array('category', null, PARAM_TEXT);
but it gives the following error
That var_dump() on line 40 is $categoryFilter, which comes out as null. Using optional_param() captures one value correctly but ignores the others.
Searching through the documentation as well as a general google search didn't help, so can anyone on here help me out? What am I missing?