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

[eluser]Peter Dräxler[/eluser]
Hello,

my Datamapper is producing this error:

Quote:Fatal error: Call to undefined method CI_DB_mysql_driver::dm_call_method() in C:\whatever\application\libraries\datamapper.php on line 1113

I found that it can be caused by incorrect installation, but this is not the case since bootstrap.php is loaded correctly.

Can anyone help with what does this error mean?
Thank you.
#2

[eluser]Peter Dräxler[/eluser]
I've been using this to load a controller from another controller:
Code:
$this->load->library("../controllers/controller.php");

When I avoid this, everything works fine.
#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.
#4

[eluser]noideawhattotypehere[/eluser]
[quote author="Peter Dräxler" date="1384440815"]I've been using this to load a controller from another controller:
Code:
$this->load->library("../controllers/controller.php");

When I avoid this, everything works fine.[/quote]

You should use HMVC for that.




Theme © iAndrew 2016 - Forum software by © MyBB