Welcome Guest, Not a member yet? Register   Sign In
Datamapper 1.8.2:... undefined method CI_DB_mysql_driver::dm_call_method()
#3

[eluser]CroNiX[/eluser]
I don't think you can load a controller manually using stock CI. If you need to use a controller in multiple places, it sounds like it, or at least some methods, should really be a "library" which both controllers can load and use.

If you need to use CI functions/methods in your library, you can load the CI object.

Code:
class Somelibrary {

  protected $CI; //variable to hold CI's object

  public function __construct()
  {
    $this->CI =& get_instance();  //assign it
  }

  //use CI in a method
  public function foo()
  {
    $this->CI->load->view('some_view');
  }
}

Then controller A can:
Code:
$this->load->library('somelibrary');
$this->somelibrary->foo();

And controller B can do the same.

Or if it's something you use a lot, you can autoload it.


Messages In This Thread
Datamapper 1.8.2:... undefined method CI_DB_mysql_driver::dm_call_method() - by El Forum - 11-14-2013, 09:27 AM



Theme © iAndrew 2016 - Forum software by © MyBB