I have two controller and one model like below, I want to call second controller method in side model. But i am not getting how to call it.
1) Controller1
class controller1 extends CI_Controller {
function __construct() {
parent::__construct();
$this->load->model('job');
}
public function getjob() {
$this->job->check_payment();
}
}
2) Paypal.php (controller)
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Paypal extends CI_Controller {
function __construct() {
parent::__construct();
$this->load->model('job');
// Load helpers
$this->load->helper('url');
// Load PayPal library
$this->config->load('paypal');
$config = array(
'Sandbox' => $this->config->item('Sandbox'),
'APIUsername' => $this->config->item('APIUsername'),
'APIPassword' => $this->config->item('APIPassword'),
'APISignature' => $this->config->item('APISignature'),
'APISubject' => '',
'APIVersion' => $this->config->item('APIVersion')
);
// Show Errors
if ($config['Sandbox']) {
error_reporting(E_ALL);
ini_set('display_errors', '1');
}
$this->load->library('Paypal_pro', $config);
}
function sendPayemnt() {
echo "Hello...";
}
}
2) Job.php (model)
class Job extends CI_Model {
function check_payment() {
// I want to call method of Paypal controller here...
}
}
I hope someone help me to solve it. Thanks,