If you are looping I would recommend using create()

foreach(data[Image] as image){
         $this->ImageSet->Image->create();
         $this->ImageSet->Image->save($image);
 }

On 6/1/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
> It doesn't really matter whether you are working from the Image model
> or from the ImageSet model. If you are adding more than one record,
> simply loop through the data and add the records.
>
> See: "Saving Related Model Data" in
> http://manual.cakephp.org/chapter/models
>
> ImageSetController{
>    function add(){
>       foreach(data[Image] as image){
>          $this->ImageSet->Image->save($image);
>       }
>    }
> }
>
> On Jun 1, 10:17 am, Nasko <[EMAIL PROTECTED]> wrote:
> > Hello,
> >
> > This is my second CakePHP-driven project, so I'm a newbie. I'm
> > building an image gallery, where images can be tagged.
> > Before someone curses me - I did search the old wiki archives, the
> > bakery and this group's discussions and have already read several
> > gallery tutorials. However, I have a feature that I cannot quite grasp
> > with respect to the CakePHP ways: instead of uploading one image at a
> > time  and invoking the 'add' action of my Image controller, I want to
> > use a flash widget which allows for multiple-file upload. The way I
> > see it, it would be best to use the 'add' action of the parent  model
> > - ImageSet to handle the multiple images uploaded.
> > My question is: how would I actually add all those images, using the
> > parent ImageSet controller?
> >
> > Thanks!
>
>
> >
>


-- 
(the old fart) the advice is free, the lack of crankiness will cost you

- its a fine line between a real question and an idiot

http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to