Hi SilverStripe guys,
I've an array:
protected $choices = array(
'Stafstaal',
'Balkstaal',
'Strippen',
'Platen',
'Speciaalstaal',
'Ronde buizen',
'Profielbuizen',
'Betonstaal',
'Bouwstaalmatten',
'Koudgewalste profielen'
);
this array has got 10 items,
So i want them as checkboxes so i use this code:
new CheckboxSetField(
'Producten',
'Wilt u meer weten over onderstaande productgroepen?',
$this->choices,
1
);
And then i use this code:
if ($key == 'Producten')
{
$selected_values = explode(',', $value);
$selected_products = array();
foreach ($selected_values as $value) {
$selected_products[] = $this->choices[$value];
}
$value = implode(', ', $selected_products);
}
So when i send this form to my email, i only see 9 items in my mail.
The first one is not in my mail (stafstaal).
And when i put /* and */ on the if statement, and send to my mail, i see an array 1,2,3,4,5,6,7,8,9. But normally
an array starts at 0 :P
Can anyone help me to get this work?
Should not be that hard but i cant figure it out...
Thanks!!!!