Hi, I have the following hook
PHP Code:
class LanguageLoader
{
function initialize() {
$ci =& get_instance();
$ci->load->helper('language');
$site_lang = $_SESSION['site_lang'];
//$site_lang = $ci->session->site_lang;
if ($site_lang) {
$ci->lang->load('general', $site_lang);
} else {
$ci->lang->load('general', 'english');
}
}
}
With the line
PHP Code:
$site_lang = $_SESSION['site_lang'];
I get the following error
PHP Code:
A PHP Error was encountered
Severity: Notice
Message: Undefined index: site_lang
Filename: hooks/LanguageLoader.php
Line Number: 12
Backtrace:
File: C:\xampp\htdocs\availability-calendar\application\hooks\LanguageLoader.php
Line: 12
Function: _error_handler
File: C:\xampp\htdocs\availability-calendar\index.php
Line: 315
Function: require_once
but replacing it with
PHP Code:
$site_lang = $ci->session->site_lang;
resolves the problem. I'm curious to know what the issue was though. Thanks.