Hello I am having trouble running more than one model in my controller.
The first model is encryption then the second model is insertion.
public function addStore()
{
$name = $_POST['name'];
$address = $_POST['address'];
$gpsAddress = $_POST['gps_address'];
$phone = $_POST['phone'];
$email = $_POST['email'];
$password = $_POST['password'];
$status = 1;
$this->load->model('EncryptionModel');
$password = $this->EncryptionModel->encryptPassword($password);
$this->load->model('StoresModel');
$this->StoresModel->addStore($name, $address, $gpsAddress, $phone, $email, $password, $status);
}
The following is the error
Fatal error: Call to a member function addStore() on a non-object in \application\controllers\stores.php
This does not occur when the encryption model call is taken out.
Encryption Model as requested
class EncryptionModel extends CI_Controller {
public function encryptPassword($password)
{
$options = ['cost' => 12];
$password = password_hash($password, PASSWORD_BCRYPT, $options)."
";
return $password;
}
}