Hey Martin, interesting trick.  This isn't technically "sactioned" by
the API, and could at some point change, but I agree that there needs
to be a way to do this, so we'll look at formalizing one in the
future.

On Dec 8, 10:26 am, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> I may have added it to the manual... not sure since it has been acting
> a bit strange today and the post timed out.
> I will check later to see if my edit was submitted.
>
> On Dec 8, 2:59 pm, "dr. Hannibal Lecter" <[EMAIL PROTECTED]> wrote:
>
> > Sweet! Thanks for sharing this, it should probably be added to the
> > official manual or something..
>
> > On Dec 8, 2:14 pm, "[EMAIL PROTECTED]"
>
> > <[EMAIL PROTECTED]> wrote:
> > > Hi,
> > > This is just a small thing but I did not find a mention of it in the
> > > manual. I found this out today, after a few years of using Cake :)
>
> > > I want a form input to have the name Modelname[][fieldname] so that I
> > > can post an array of "fieldname" values. The manual only mentions
> > > creating these "hard coded" as Modelname.0.fieldname => Modelname[0]
> > > [fieldname] and then incrementing the number.
>
> > > The reason I like the "empty" version is that is makes for a lot
> > > simpler javascript when I want to create these additional fields on
> > > the fly in the GUI and don't know how many I will need at the time of
> > > rendering the form on the server.
>
> > > Then I tried this (half by accident):
>
> > > $form->input('Modelname. .fieldname'); // notice the space between the
> > > dots
>
> > > Voila! The form has the empty space in the field name but Cake creates
> > > the array of values just the way Iike it.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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