Welcome Guest, Not a member yet? Register   Sign In
Model & igniter2.0
#1

[eluser]Unknown[/eluser]
Hi I have create a simple model

class User_model extends CI_Model {

function __construct()
{
parent::__construct();
}

function hello()
{
echo 'hello';
}

}?>

i put the file in application/models/user_model.php

I call it from my controller
$this->load->model('User_model');

and i have this error
Fatal error: Class 'User_model' not found in /home/arredoem/public_html/newAEM/system/core/Loader.php on line 198

Can you help me?
#2

[eluser]toopay[/eluser]
1. No need to put "?>" at the end of your Model class.
2. How your method, to call that model? its should be something like
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Welcome extends CI_Controller {

    function __construct()
    {
        parent::__construct();
    }

    function index()
    {
        $test=$this->load->model('User_model')->hello();
        echo $test;
    }
}




Theme © iAndrew 2016 - Forum software by © MyBB