I need your help, please! I have 2 models with the same name
1.... application/admin/user/models/User_model.php, with this code:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class User_model extends CI_Model
?>
2.... application/front/user/models/User_model.php, with this code:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class User_model extends CI_Model
?>
Both classes without differences.
I need to use application/admin/user/models/User_model.php
from application/front/user/controllers/User.php
I tried to do the following changes:
If I add in application/front/user/models/User_model.php the namespace like this code:
<?php namespace customers;
defined('BASEPATH') OR exit('No direct script access allowed');
class User_model extends \CI_Model
<?
And from application/front/user/controllers/User.php, I call application/admin/user/models/User_model.php always gives me an error as application/front/user/models/User_model.php was not loaded.
If I delete the namespace from application/front/user/models/User_model.php my code always goes to this mode NEVER to admin/user/user_model.
I need to AVOID change admin/user/User_model.php because a lot of classes uses this MODEL.I only can change front/user/User_model.php
But I need to USE admin/user/user_model.
I call application/admin/user/models/User_model.php like this:
$this->load->model('user_model');
I need to load application/admin/user/models/User_model.php
Please help me!!!! Thx! Ani
config.php, please. Might be you configured to load models from:front/user/models.