CONTROLLER:

function add($patient_id = null) {
    if (empty($this->data))  {
        if (!empty($patient_id)) {
            $this->data['YourModelName']['patient_id'] = $patient_id;
        }
    } else {
        ...
    }
    ...
}

FORM:
echo $form->create('YourModelName');
echo $form->hidden('patient_id');

LINK calling add() action for first time:
echo $html->link('New record', array(
    'controller' => 'your_controller',
    'action' => 'add',
    9999 // <- patient id passed as an argument to add() action
));

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

Reply via email to