my projects/view view has a line like this...
<li><?php echo $html->link('Add Sequence','/sequences/add/'.$project
['Project']['id'],array('title'=>'Add Sequence')); ?></li>
then my sequences/add view has this:
echo $form->hidden('project_id',array('value' => $project_id));
and my sequenceController controller has this...
function add($project_id) {
if (!empty($this->data)) {
$project_id = $this->params['Project']['id'];
$this->Sequence->create();
if ($this->Sequence->save($this->data)) {
$this->set('project_id',$project_id);
$this->Session->setFlash(__('The Sequence has
been saved', true));
$this->redirect(array('action'=>'index'));
} else {
$this->Session->setFlash(__('The Sequence could
not be saved.
Please, try again.', true));
}
}
$projects = $this->Sequence->Project->find('list');
$this->set(compact('projects'));
}
what am i doing wrong...
i want that when creating new sequences they will automatically be
assigned the project id...
thanks
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---