El error es el siguiente, al extender la clase Register del MY_Controller para crear el logeo de usuario, me lanza el siguiente error. ¿Alguna idea?
Dice que no ha encontrado la clase, pero aun añadiéndola tampoco la encuentra.
Controlador para el registro en .php
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Register extends MY_Controller
{
public function index()
{
$this->load->library('form_validation');
$this->form_validation->set_rules('first_name', 'First name','trim|required');
$this->form_validation->set_rules('last_name', 'Last name','trim|required');
$this->form_validation->set_rules('username','Username','trim|required|is_unique[users.username]');
$this->form_validation->set_rules('email','Email','trim|valid_email|required');
$this->form_validation->set_rules('password','Password','trim|min_length[8]|max_length[20]|required');
$this->form_validation->set_rules('confirm_password','Confirm password','trim|matches[password]|required');
//En caso de que no pueda registrarse correctamente lo redirecciona al index de nuevo
if($this->form_validation->run()===FALSE)
{
$this->load->helper('form');
$this->render('register/index_view');
}
else
{
$first_name = $this->input->post('first_name');
$last_name = $this->input->post('last_name');
$username = $this->input->post('username');
$email = $this->input->post('email');
$password = $this->input->post('password');
$additional_data = array(
'first_name' => $first_name,
'last_name' => $last_name
);
$this->load->library('ion_auth');
if($this->ion_auth->register($username,$password,$email,$additional_data))
{
$_SESSION['auth_message'] = 'The account has been created. You may now login.';
$this->session->mark_as_flash('auth_message');
redirect('user/login');
}
else
{
$_SESSION['auth_message'] = $this->ion_auth->errors();
$this->session->mark_as_flash('auth_message');
redirect('register');
}
}
}
}