I have a form which contains a collection. So I have:
/* my type */
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
In a submit or if you are editing, you can access the data when you turn the FormBuilder into a Form instance. And for a collection type you can try this:
...
$form = $formBuilder->getForm();
...
if ($this->getRestMethod() == 'POST') {
$form->handleRequest($this->get('request'));
if ($form->isValid()) {
$formData = $form->getData();
foreach ($formData['photos'] as $key => $collectionRow) {
var_dump($collectionRow['photoname']);
var_dump($collectionRow['size']);
}
}
}