I want to put data from an extern webservice into my SilverStripe website. I can get the data in an array bij this code:
public function getBlogs(){
$service = new RestfulService("http://www.xxxxx.com/jsonservice/BlogWeb/");
$response = $service->request("getBlogs?token=xxxxx&id=250");
print_r(json_decode($response->getBody()));
}
This shows the right data array in my website. But how can I handle this data to use it in the templates, like:
<% loop getBlogs %>$Title<% end_loop %>
Thanks in advance.