Welcome Guest, Not a member yet? Register   Sign In
How i can use model in other model?
#10

[eluser]jurosik[/eluser]
Browser won't open the page: "the server unexpectedly dropped the connection"

it happens after i load model in another model which i am calling function

In controller
Code:
class Jobs extends Controller {

    function Jobs()
    {
        parent::Controller();
        
        $this->load->model('main_model');
        $this->load->model('data_model');
    }
      
       function something()
       {
                $data = $this->data_model->getData('jobs');
       }

In Data_model
Code:
class Data_model extends Model {

    function Data_model()
    {
        parent::Model();
        $this->CI =& get_instance();
        $this->CI->load->model('main_model');
        $this->CI->load->model('file_model');
    }
        
        function getData($table)
        {
                $output =     $this->db->get($table);
        
                return $output;
        }

Main_model
Code:
class Main_model extends Model {

    function Main_model()
    {
        parent::Model();
        $this->CI =& get_instance();
        $this->CI->load->model('data_model');  // HERE is problem
        $this->CI->load->model('file_model');
    }


Messages In This Thread
How i can use model in other model? - by El Forum - 12-30-2007, 06:09 AM
How i can use model in other model? - by El Forum - 12-30-2007, 07:32 AM
How i can use model in other model? - by El Forum - 12-30-2007, 07:39 AM
How i can use model in other model? - by El Forum - 12-30-2007, 07:46 AM
How i can use model in other model? - by El Forum - 12-30-2007, 07:55 AM
How i can use model in other model? - by El Forum - 01-05-2008, 01:02 PM
How i can use model in other model? - by El Forum - 01-05-2008, 01:08 PM
How i can use model in other model? - by El Forum - 01-05-2008, 01:19 PM
How i can use model in other model? - by El Forum - 01-05-2008, 01:34 PM
How i can use model in other model? - by El Forum - 01-05-2008, 01:48 PM



Theme © iAndrew 2016 - Forum software by © MyBB