I'm new in codeigniter, I want 2 page with the name of "login" and "admin"
i use hook and session to detect user is logged in or not, but unfortunately hook didn't load (Call) at all.
any idea?
My controller :
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class Auth extends CI_Controller{
public function __construct(){
parent::__construct();
}
public function index(){
}
}
My hook :
<?php if ( !defined( 'BASEPATH' ) ) exit( 'No direct script access allowed' );
class Auth_hook {
protected $CI;
public function __construct() {
$this->CI =& get_instance();
}
public function index(){
print_r("hello!!");
}
}
}
?>
EDIT: And finally hooks.php :
$hooks['pre_controller']=array(
'class'=>'Auth_hook',
'function'=>'index',
'filename'=>'Auth_hook.php',
'filepath'=>'hooks'
);