I want to load helper in pre controller action, can anyone please help me for that, i am getting error Call to undefined function load_helper()
, here is my code for that
$hook['pre_controller'] = function()
{
$this->CI = get_instance();
$router =& load_class('Router', 'core','uri','url');
$helper =& load_helper('uri','url');
$controller_name = $router->fetch_class();
$action_name = $router->fetch_method();
try {
$rc = new ReflectionClass($controller_name);
} catch (Exception $ex) {
//redirect(site_url($controller_name.'/overview'));
$url = site_url($controller_name.'/overview');
header("Location:".$url);
exit;
}
};