I'm very new to codeigniter-3 framework and I'm using a model in a controller like this $this->load->model('model_name')
It's working fine, I'm trying Using the following way but it threw an error, can you help me fix this
An uncaught Exception was encountered Type: Error Message: Class 'models\TestModel' not found
TestController.php
<?php defined('BASEPATH') OR exit('No direct script access allowed'); use \models\TestModel; class TestController extends CI_Controller { public function student(){ $obj = new TestModel(); $value = $obj->student_college(); echo $value; } }
You can have a try