Group,
I am a newbie(to cake & php) & facing apparently a small issue, but
unable to recover.
There are 2 models,
1. LifeUser Model ( id, uid (visible to user), username, etc.)
2. Membership Model (id, uid (not visible to user), accountnumber ,
etc.)
The common key between them in UserID (UID).
Using Form Helpers.
The idea is to pass the UID from LifeUser Form on "Submit" and using
it Membership register method.
While I do get the UID, ( as url) on submitting the form it goes to
NULL.
How do I carry this in the next session?
TIA,
-Sujay
<?php
class LifeusersController extends AppController
{
var $name = 'Lifeusers';
var $helpers = array('Html', 'Form');
function register()
{
if(!empty($this->data))
{
if($this->Lifeuser->save($this->data))
{
$this->Session->setFlash('Please add further details');
$this->set('var0',$this->data['Lifeuser']['uid']);
//this is for testing
$this->redirect(array('controller'=>'memberships',
'action'=>'register',$this-
>data['Lifeuser']['uid']));
//passing the uid to next register page
}
}
}
}
?>
<?php
class MembershipsController extends AppController
{
var $name = 'Memberships';
var $helpers = array('Html', 'Form');
//id is carrying the UID from previous submit.
function register($id)
{
$this->set('var1’,$id);
//for testing, uid is carried from previous page
if(!empty($this->data))
{
$this->set('var2’,$id);
//for testing, don’t get the value in id, after submitting
form.???? ---- What's wrong?
if($this->Membership->save($this->data))
{
$this->Session->setFlash(‘Almost Done’);
}
$this->Membership->read(null);
$this->Membership->set('uid',$id);
$this->Membership->save();
}
}
}
?
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
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