Welcome Guest, Not a member yet? Register   Sign In
Getting error while trying to load a model
#1

[eluser]Unknown[/eluser]
Hi,
I am getting following error while trying to load a model from a controller class.
Quote:Fatal error: Class 'Data' not found in C:\xampp\htdocs\reg\system\libraries\Loader.php on line 18

'Data' is the class name of the model data.php
Also, I am using following code in controller class to load a model data.php

Code:
$this->load->model('data');

I am using xampp. I tried using xampp 1.7.1 and 1.7.2.

Kindly help me to solve this issue.

Thanks in advance,
P12A5
#2

[eluser]flaky[/eluser]
1. Make sure your model file name is
Code:
data_model.php
2. Make sure the class name of the model is
Code:
class Data_model extends Model {....
3. Using the model in some controller
Code:
$this->load->model('data_model');
.
.
.
$this->data_model->add_some_data($data);




Theme © iAndrew 2016 - Forum software by © MyBB