Silverstripe Version: 4.3
I’d like to put some charts on a page and have a custom SQL query in my model that returns an array.
I need to convert it to JSON and pass the JSON data either to a ChartJS script or to a template via data attribute.
When I return json_encode($data) in the model, it ends up in the template like this: {"years":[2015,2016,2017,2018], …
Is there any way how to prevent this XML conversion?
Thanks.
Martin