As long as the form elements are named using the cake conventions i.e.
name="data[ModelName][fieldName]" (best acheived by using the
FormHelper functions) there should be no difference between single and
multi-model forms.
The only difference is when you need to validate both models before
saving either. In the controller you need to call $this->ModelOne-
>validates() and $this->ModelTwo->validates() before calling the save
functions.
Also you will need to add $uses = array('ModelOne', 'ModelTwo') to
your controller to be able to access both models properly.
Geoff
--
http://lemoncake.wordpress.com
On Sep 19, 5:19 am, nryan <[EMAIL PROTECTED]> wrote:
> Hello -- I have another question regarding the 'right way' to do
> something with cake.
>
> I have a form on a page which updates 2 different models. Is there a
> recommended way to structure the page in cake? Like, where should the
> form-handling logic go? Anyone have a suggested way to make the most
> out of cake's validation/saving?
>
> Thank you!!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---