Could you be more specific please :)
The most logical way to do this I thought would be
<?=$form->input('Addressbook.$ID.title', array('value' => Default
value))?>
<?=$form->input('Addressbook.$ID2.title', array('value' => Default
value))?>
<?=$form->input('Addressbook.title.$ID', array('value' => Default
value))?>
<?=$form->input('Addressbook.title.$ID2', array('value' => Default
value))?>
Where $ID/$ID2 is Addressboooks.id e.g. 0 and 1 if I want to create
new addressbook entry, or 25 and 26 if I want to update entries with
id's 25 and 26
But it doesn't work
On Nov 10, 6:40 am, "Xavier Mathews" <[EMAIL PROTECTED]> wrote:
> You need Arrays!
>
> On 11/09/2008, Lukas <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > Hi everyone :)
>
> > This is the first time I had to use HABTM, and I'm facing a problem
> > when I have to save data
>
> > Lets say I have
>
> > MODELS:
> > class Service extends AppModel
> > {
> > var $hasAndBelongsToMany = array( 'Addressbook' );
> > );
>
> > class Addressbook extends AppModel
> > {
> > var $hasAndBelongsToMany = array ('Service');
> > }
> > Addressbook: id, phone, ...
>
> > CONTROLER:
> > function save() {
> > $this -> Service -> id = $this -> data['Service']['id'];
>
> > $this -> Service -> save($this -> data);
> > }
>
> >>> How does add.ctp should look like if e.g. I want to add a Service record
> >>> with 2 new phone numbers?
>
> > Sketch of result
>
> > Title {Service.title}
> > About {Service.about}
> > Phone Number 1 {Addressbook.phone.}
> > Phone Number 2 {Addressbook.phone}
>
> > I've tried many (I hope I don't have to post them all here :) )
> > combinations of $form helper usge, but I could get wanted result :(
>
> > Thank you.
>
> --
> Xavier A. Mathews
> Student/Developer/Web-Master
> GG Client Based Tech Support Specialist
> Hazel Crest Illinois
> [EMAIL PROTECTED]@[EMAIL PROTECTED]
> "Fear of a name, only increases fear of the thing itself."
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---