accessing sessions in MY_loader.php - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: accessing sessions in MY_loader.php (/showthread.php?tid=21816) |
accessing sessions in MY_loader.php - El Forum - 08-21-2009 [eluser]Unknown[/eluser] I'm extending my loader so that I can add some extra stuff into the view() function for my templates. Basically I have a sidebar that's updated and changed depending on what controller you're viewing, and if you're logged in or not as well as setting variables that display private messages/logout links. How can I access the sessions from within the loader? I have sessions in the autoload config. Here is my code Code: class MY_Loader extends CI_Loader The error it returns: Quote:A PHP Error was encountered accessing sessions in MY_loader.php - El Forum - 08-21-2009 [eluser]pistolPete[/eluser] You need access to the CI superobject (see user guide) Code: class MY_Loader extends CI_Loader accessing sessions in MY_loader.php - El Forum - 08-21-2009 [eluser]Unknown[/eluser] Aahh thank you very much. I was looking in the wrong area of the user guide. |