Wednesday, January 28, 2009

Re: Multiple Uploads with MeioUpload

Not that I've used this behaviour or even tried uploading yet but
would have thought the solution lied in the naming of your fieldnames
to create an array and using the saveAll() method as follows:

For saving multiple records of single model $data needs to be a
numerically indexed array of records like this:

Array
(
[0] => Array
(
[fieldA] => fieldA 1
[fieldB] => fieldB 1
[fieldC] => fieldC 1
)
[1] => Array
(
[fieldA] => fieldA 2
[fieldB] => fieldB 2
[fieldC] => fieldC 2
)
)

The command for saving the above $data array would look like this:

$this->Model->saveAll($data['Article']);

Taken from the CookBook URL:
http://book.cakephp.org/view/75/Saving-Your-Data
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: