[eluser]Jatinder Thind[/eluser]
Even after fixing the "gloabl" typo, it won't work. To know why, you have to first understand how a helper is loaded. When you call
Code:
$this->load->helper(array('url', 'setting'));
The helper() function simply includes the setting_helper.php file. Therefore
$var2 will be available only within the local context of helper() function and won't be visible outside this function.
Change your helper as below at it will work:
Code:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
define("__VARIABLE1__","variable1");
$GLOBALS['var2'] = "variable2";
?>