Я хоть убей, не могу понять, почему я получаю ошибки при установке CodeIgniter и текущей настройке MVC.
Я вижу ошибку:
Неустранимая ошибка: вызов неопределенного метода Login::users_model() в /var/www/application/controllers/login.php в строке 17
Контроллер application/controllers/login.php
class Login extends CI_Controller
{
public function __construct()
{
parent::__construct();
}
public function index()
{
$data = '';
$this->load->model('users_model');
$data['testing'] = $this->users_model()->test_user();
$this->load->view('home', $data);
}
}
Модель application/models/users_model.php
class Users_model extends CI_Model
{
function __construct()
{
// Call the Model constructor
parent::__construct();
}
function test_user()
{
return 'Test User #1';
}
}
Просмотр application/views/home.php
echo $testing;
Подробнее: https://stackoverflow.com/questions/211 ... fatal-erro
Мобильная версия