How can I add a sub-array structure in my results? $_POST
Solutions
I managed to solve my own problem. It was a problem with the #tree. I have to set #tree in the parents to true..
So if you want an array with the following structure:
array {
["parent"]=>
array(4) {
[1]=>
array(9) {
[1]=>
int(1)
[2]=>
int(0)
[3]=>
int(0)
[4]=>
int(0)
[5]=>
int(0)
[6]=>
int(0)
[7]=>
int(0)
[8]=>
int(0)
[9]=>
int(0)
}
}
}
I had to configure #tree for the parents (2 here), and not only for the children
['parent']['#tree'] = true
['parent'][1]['#tree'] = true
I figured it out after trying and reading https://www.drupal.org/node/48643 (Archived, but it worked for me ;) )