Welcome Guest, Not a member yet? Register   Sign In
session use in libraries
#1

[eluser]dmzSmile[/eluser]
Hi Guys, I was wondering of if it’s possible to use a session library in my own library. I’m writing a Lib, which will select the language automatically, on base of the session-stored variable. So I’ll need to get into my session data first to get the user language variable. But it seems not to work.

Is it possible?
Or have you better idea of resolving the problem of language selection.

Or maybe i should write this code in regular plugin?

regards
dmzSmile
#2

[eluser]Cro_Crx[/eluser]
Hey dmz

I think you generally shouldn't need to reference another library in the one you are writing. It is possible, but I wouldn't recommend. It might be better if you wrote a plugin/helper to perform this instead.
#3

[eluser]Tom Schlick[/eluser]
in your library
Code:
$this->CI =& get_instance();
$data = $this->CI->session->userdata('youritemname');

is that what you were talking about?




Theme © iAndrew 2016 - Forum software by © MyBB