Re: Saving multiple database records from a single form.

2007-05-01 Thread Toad

Thanks for your reply alan. Actually i thought about that. But was
hoping there is some easier solution using cake features. Maybe this
should be a feature request?

On Apr 30, 11:44 pm, alan <[EMAIL PROTECTED]> wrote:
> I would think that you would need to do some custom parsing here...  I
> usually solve this by creating a higher dimensional array...  perhaps
> something along the lines of:
>
> --
> 
> 
> --
> 
> 
> --
>
> Then, in the controller, you simply do something like:
>
> foreach ( $this->data['m'] as $itemkey => $data ) {
>$this->Model->create();
>if ( $this->Model->save($data) ) {
>   ...
>}
>
> }
>
> thanks,
> -alan-


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Saving multiple database records from a single form.

2007-04-30 Thread alan

I would think that you would need to do some custom parsing here...  I
usually solve this by creating a higher dimensional array...  perhaps
something along the lines of:

--


--


--

Then, in the controller, you simply do something like:

foreach ( $this->data['m'] as $itemkey => $data ) {
   $this->Model->create();
   if ( $this->Model->save($data) ) {
  ...
   }
}

thanks,
-alan-


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Saving multiple database records from a single form.

2007-04-29 Thread Toad

Hi, i have a "Tasks" controller that must allow users to report
working hours for each task they have, so what i need is  a form to
let the users enter hours for several tasks at the same time and then
submit it all together. I cant figure out how to do this using the
html helper.
This is a simplification of what i have in my view:


   
   checkbox('Task/doreport');?>
   :
input('Task/hours');?>


submit('Report', array('class'=>'button'));?>

But this will work only for one task, not for a group of tasks! Any
ideas on how to do things like that in Cake?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Saving multiple database records from a single form.

2007-04-29 Thread Toad

Hi All,
I need a form that contains multiple input fields for multiple
database records in one page.
To be more specific i have a tasks controller and i need the user to
be able to report hours for several tasks at once.
So the user will go to report page check the tasks that he wants to
report and inter the amount of hours spent working on each task.
Seems pretty much easy task but i cant figure out how to do this in
Cake style :)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---