Php – Codeigniter load models in a controller

codeigniterPHP

Two or more loaded controllers with the same name login models are not working.

E.g I have two models from same name one is login_model and other is in admin -> login_model.php then I want to load both in a single controller.

How can I do that?

Best Answer

You can do this like this:

$this->load->model("login_model","login_model");

$this->load->model("admin/login_model","admin_login_model");