Silverstripe Version: 4.2
Question:
I am trying to build some reports but wondering about the correct way to go with using parameters. I have the following code in my report:
class MemberReport extends Report
{
public function parameterFields()
{
$fields = FieldList::create(
$start = DateField::create('StartPeriod', 'Start Date'),
$end = DateField::create('EndPeriod', 'End Date')
);
return $fields;
}
public function sourceRecords($params = null)
{
Debug::show($params);
...
}
}
Now my question is how do I correctly access those parameters? Debug is showing nothing. I can see them if I use the request in the current controller but I would have thought they should appear in the $params variable. Is the report supposed to post the filter by GET or POST? Mine is using GET (querystring).
Documentation and examples are a bit thin here. Can anyone please provide an example or instruction to help point me in the right direction.
Thank you kindly.