skater_nex
skater_nex

Reputation: 463

Multiple models in Codeigniter

I've got 2 models with the same name, but in different folders.

models
   |
   - model1
        |
        - db_model.php
   |
   - model2
        |
        - db_model.php

When I load them like this it causes a problem:

$this->load->model('model1/db_model', 'db_model1');
$this->load->model('model2/db_model', 'db_model2');

Upvotes: 0

Views: 103

Answers (1)

jmadsen
jmadsen

Reputation: 3675

The 'db_model' is an alias, so you are naming them both the same thing.

Are you doing that for a reason? Explain what you want and we'll help with a workaround

Upvotes: 1

Related Questions