如何在CodeIgniter中使用钩子,如
class SessionData{
var $CI;
function __construct(){
$this->CI =& get_instance();
}
function initializeData() {
// This function will run after the constructor for the controller is ran
// Set any initial values here
if(!$this->session->userdata('username')){ //this is line 13
redirect('login');
}
}
}