Welcome Guest, Not a member yet? Register   Sign In
$this->load->database(); doesn't work in models
#9

[eluser]krankmelder[/eluser]
Well, after some testing, you are right, it doesn't work for my own models out of the box.
What one needs to do is:
1) create a fake_model.php with CI_Model instead of CI_Controler.
2) add every model one writes to the fake_controller.php and fake_model.php

fake_controller.php
Code:
<?php
class CI_Controller {
/**
  *
  * @var Mylogin - Does user login, logout, checks
  */
public $Mylogin;

/**
  *
  * @var Myget - Performs select-get actions on the database
  */
public $Myget;

/**
  *
  * @var CI_DB_active_record
  */
public $db; .............

Like this, you have auto-completion in Eclipse for Codeigniter 2.1.2. also for your self-written models.


Messages In This Thread
$this->load->database(); doesn't work in models - by El Forum - 09-05-2012, 05:03 AM
$this->load->database(); doesn't work in models - by El Forum - 09-05-2012, 01:23 PM
$this->load->database(); doesn't work in models - by El Forum - 09-05-2012, 01:56 PM
$this->load->database(); doesn't work in models - by El Forum - 09-06-2012, 12:48 AM
$this->load->database(); doesn't work in models - by El Forum - 09-06-2012, 01:12 AM
$this->load->database(); doesn't work in models - by El Forum - 09-06-2012, 01:15 AM
$this->load->database(); doesn't work in models - by El Forum - 09-06-2012, 01:25 AM
$this->load->database(); doesn't work in models - by El Forum - 09-06-2012, 01:34 AM
$this->load->database(); doesn't work in models - by El Forum - 09-06-2012, 01:53 AM



Theme © iAndrew 2016 - Forum software by © MyBB