RE: Forms: HABTM with additional fields in join table

2010-01-13 Thread Dave
I had the same problem with very little help but my situation was different
and had multiple models using the join table, but after a lot of trial an
error I managed to get it.

I scrapped the HABTM joins and went with the hasMany aproach. Uses the same
number of models, use you standard modela_modelb join table add all the
fields you want. I needed a checkbox but ended up switching to a select as
it was more ideal for my setup but the problem that I had was population of
the fields because the data array came back as [0][1][2] and it never lined
up with my field keys so I had to edit the array info to return the array
like 
[6]=> something
[9]=> you get the idea

And my fields were

modelA.6.name
modelA.9.name

Degug your data to see what comes back and from there figure out how to get
what you need from what you have.

Dave



-Original Message-
From: cake-php@googlegroups.com [mailto:cake-...@googlegroups.com] On Behalf
Of Ernesto
Sent: January-13-10 12:31 PM
To: CakePHP
Subject: Forms: HABTM with additional fields in join table

Hello.

Person HABTM Training

i'm coding the Person::add and Person::edit views

there's plenty of examples/tutorials wich explains how to code an HABTM
form... but unfortunately none of them explains how to add additional
information in the join table (in my case "who_added_this_relationship",
"expiration_date" and "notes").

almost forgot... training_id should be a select box.

can someone help me plz?




No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.725 / Virus Database: 270.14.130/2607 - Release Date: 01/13/10
04:05:00

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Forms: HABTM with additional fields in join table

2010-01-13 Thread Ernesto
Hello.

Person HABTM Training

i'm coding the Person::add and Person::edit views

there's plenty of examples/tutorials wich explains how to code an
HABTM form... but unfortunately none of them explains how to add
additional information in the join table (in my case
"who_added_this_relationship", "expiration_date" and "notes").

almost forgot... training_id should be a select box.

can someone help me plz?



Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en