April 25, 2012
I want to define variable in CodeIgnitor so that it can be accessed in application
Question by Musaddiq Khan
e.g array of constants so that it can be accessed in controllers, views, models.
Thanks
Answer by Starx
If you are looking for globally accessible datas, then session is more than just a storage feature.
Set the session values like this
$this->session->set_userdata('item', 'value');
And read the values like this
$this->session->userdata('item');