Hi.
I'm trying to render an Ajax response with a specified template.
My controller code looks like this:
$data = array(
'Items' => array( 'Test1', 'Test2', 'Test3' ),
'Pairs' => array( 'Foo' => 'Bar' ),
);
return $this->customise($data)->renderWith('AjaxResponse');
Now, in the template, I can use the control Items to get the iterator:
<% control Items %>
<item />
<% end_control %>
So it prints three separate items, but I am unable to get their contents.
How can I print out 'Test1','Test2','Test3' in Items control?
I also tried to use $Pairs.Foo, but it still didn't work.
So I've got two questions:
1. How should I construct the $data array to use it as controls in the template?
2. Is it possible to get the keys, not only values, from a control?