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
-~----------~----~----~----~------~----~------~--~---