As scs stated, are you saving the additional information in a separate
table or in the profile table as 10 independent columns?
Depending on your answer, we will try better to help you :)
In my own opinion, scs' idea is sound!
And if I remember correctly, then CakePHP can accepts more than one
record for the related table if you use the form field definition as
Model.indexNumber.fieldname - example: Userinfo.0.uservalue.
That should also make it easier for you to create the 10 additional
information form fields by looping!
Enjoy,
John
On Jan 6, 9:45 pm, "Dave" <make.cake.b...@gmail.com> wrote:
> Yeah I could do that but the average user will not have more than 3 or 4 and
> honestly its more of a pain to add new, add new, add new 3 or 4 times for
> the user. This way its all done on 1 page in 1 shot.
>
> -----Original Message-----
> From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
>
> Of scs
> Sent: January-06-10 4:02 PM
> To: CakePHP
> Subject: Re: Add Fields
>
> The way I would handle this is to add a new table (1->Many) this way you can
> allow the user to enter as many fields they want.
> example:
> CREATE TABLE profile_addons (
> id int(10) unsigned NOT NULL auto_increment,
> profile_id int(11) unsigned NOT NULL,
> name varchar(75) default NULL,
> PRIMARY KEY (`id`)
> ) ENGINE=InnoDB AUTO_INCREMENT=1 ;
>
> On Jan 6, 1:34 pm, "Dave" <make.cake.b...@gmail.com> wrote:
> > What would be the easiest way to add say 10 input fields to a form
> > that hasMany?
>
> > I am allowing a user to add additional info to a profile and want to
> > have 10 empty fields where they can type in whatever they want.
>
> > I can manually make a form with 10 input fields but would like to know
> > a simplified approach.
>
> > Working with the idea of a foreach and build the fields but cant seem
> > to get the idea of how to loop thru when there is nothing to loop ):
>
> > $count++
> > if $count > 10 type idea
>
> > Ideas to point me in the right direction would be great.
>
> > Thanks
>
> > Dave
>
> No virus found in this incoming message.
> Checked by AVG -www.avg.com
> Version: 9.0.725 / Virus Database: 270.14.124/2599 - Release Date: 01/06/10
> 04:05:00
No comments:
Post a Comment