I am using Cake 2.1 and have a two models, Domain & Location which use
the DomainsLocation join table. In the DomainController, I have a
function called AddLocation() which I want to add a record to the
DomainsLocation table so that the domain knowns which locations belong
to it. So here is my question, How do I setup my form for the domain
whos id=32?

$this->Form->create('Domain');
$this->Form->input('DomainsLocation.location_id');
$this->Form->input('DomainsLocation.domain_id',
array('type'=>'hidden', 'value'=>32);
$this=>Form->end('Submit');


$this->Form->create('Domain');
$this->Form->input('Domain.location_id');
$this->Form->input('Domain.id', array('type'=>'hidden', 'value'=>32);
$this=>Form->end('Submit');


$this->Form->create('DomainsLocation');
$this->Form->input('location_id');
$this->Form->input('domain_id', array('type'=>'hidden', 'value'=>32);
$this=>Form->end('Submit');

Also, do I need to use saveAll() or will save() work just fine?


Thanks in advance.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to