[eluser]riskk[/eluser]
I installed the codeigniter HMVC plugin and it's working fine for me but when I try to load method of module from other module I get the error
Here is my code:
Module billet:
Code:
class getcombo extends CI_Controller {
public function __construct()
{
parent::__construct();
}
public function index()
{
}
public function semester()
{
parent :: StartAdmin();
table_id = $this->db->select('table_id')->from('sys_tables')->where('table', 1)->get()->row()->table_id;
return table_id;
}
}
Module journal:
Code:
class journal extends MY_Controller {
public function __construct()
{
parent::__construct();
}
public function index()
{
parent :: StartAdmin();
$this->load->module('billet/getcombo')->semester();
return $this->getcombo->semester();
}
}
And error
Code:
A PHP Error was encountered
Severity: Notice
Message: Undefined property: getcombo::$db
Filename: controllers/getcombo.php
Line Number: 30
Fatal error: Call to a member function select() on a non-object in /var/www/site.com/application/modules/billet/controllers/getcombo.php
The problem occur when I use
Code:
table_id = $this->db->select('table_id')->from('sys_tables')->where('table', 1)->get()->row()->table_id;
If load method directly it`s work fine
How to fix this problem.