Hi i am using two model and i want to access that models in one
controller how can i use please help see my below code
class EmployeesController extends AppController {
var $name = 'Employees';
var $helpers = array('Html', 'Form');
function register()
{ //code
if (!empty($this->data)) {
$storeVal = $this->data['Employee']['email_id'];
$checkQuery = $this->Employee->find('all', array('conditions' =>
array('Employee.email_id' => $storeVal)));
//echo sizeof($checkQuery);
if(sizeof($checkQuery)==0){
$this->Employee->create();
if ($this->Employee->save($this->data)) {
$this->Employeelogin->create();
if($this->Employeelogin->save($this->data))
$this->Session->setFlash('The Task has been saved');
$this->redirect(array('action'=>'index'), null, true);
} else {
$this->Session->setFlash('Task not saved. Try again.');
}
}
else
$this->Session->setFlash('E-mail id already exists');
}
}
}
if i use var $uses = array('Employees','Employeelogin'); it gives
error please help hoe to solve this problem
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---