[eluser]bigmike7801[/eluser]
I want to be able to get the user_id to use in a post_controller_constructor hook but I am getting an error
Quote:Message: Undefined property: CI_Session::$user_id
.
Here's my code
Code:
<?php defined('BASEPATH') OR exit('No direct script access allowed');
class CheckProfile {
private $CI;
public function __construct(){
$this->CI =& get_instance();
$this->CI->load->library('session');
$this->CI->load->model('contractor/contractor_m');
}
function is_profile_complete(){
if($this->CI->contractor_m->profile_check($this->CI->session->user_id) == TRUE){
$this->CI->session->set_userdata('profile_complete', TRUE);
}else{
$this->CI->session->set_userdata('profile_complete', TRUE);
}
$this->CI->session->set_userdata('profile_test', "test worked");
}
}