Silverstripe Version: 4.4.1
Should be simple but I think I overlook something.
I have a function in the page controller with an array as output:
public function Address() {
$output = array(
'zip' => '2500',
'street' => 'Main Street',
'number' => '99'
);
return $output;
}
Than in the template I expected that I can get the data this way:
$Address.zip
$Address.street
or
<% loop $Address %>
$zip
$street
<% end_loop %>
But both doesn’t work.
Also tried with ArrayList:
public function Address() {
$output = array(
'zip' => '2500',
'street' => 'Main Street',
'number' => '99'
);
return new ArrayList($output);
}
What goes wrong?