I've sent arrays to CakePHP like this in the past:
$this->Form->input("Req.{$i}");
I've manually put {$i} in which is derived from the code itself in a loop. Ideally I wanted to put in something like Req.{} to generate the next key index, but it seemed only manually putting it in would work. Years later I need to have something like
$this->Form->input("Req.{$i}.list.{}");
And I'd like to avoid generating an {$i2}. Basically, I'm asking how to properly send multi-dimensional arrays to $this->request->data on POST, without having to specify an index name, much like we might have <input name='whatever[]'> in traditional PHP. I'm posting with jQuery AJAX, if that matters.
Update: Following drmonkeyninja's answer, I received
[list] => Array(
[0] => Array
(
[name] =>
)
[1] => Array
(
[value] =>
)
[2] => Array
(
[req] =>
)
)
It seems it will be required that I make an $i2 as PHP/HTML have no way of knowing that I'm not trying to make a new array for each entry.