![]() |
Session in Language Files - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Session in Language Files (/showthread.php?tid=28114) |
Session in Language Files - El Forum - 03-02-2010 [eluser]joao.sobrinho[/eluser] Hi. I'm trying to use session data in some language files. So far, I managed to use it like this: the start of a language file: Code: $CI_session = &load;_class('Session'); I use that if, to be sure that the data really exists for the rest of the file. I changed the Session Class by adding this function to keep the flashdata Code: function keep_all_flashdata() The problem with this, is that the session is loosing the data when it gets updated. It only happens when I set to use the database to sotre the session data, as I need to. Any solution to use session data inside the language files ? Session in Language Files - El Forum - 03-02-2010 [eluser]joao.sobrinho[/eluser] Hi. For now, I developed a plugin that goes to the database and gets the data I need in the language file. That access do the bd, must be done using native php function because I get errors if I try to use the CI function because it's not completly loaded at the time I need to use them. Until a beter solution apears, I'll roll with this one. PS: If someone needs the file, I can drop it here later. It gets the connection data from the file in config folder. It has a problem if you change from mysql to any other db engine... But for me, this one will work until something better apears... |