![]() |
error in included file - 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: error in included file (/showthread.php?tid=54196) |
error in included file - El Forum - 08-28-2012 [eluser]Uplift[/eluser] In my view of each page i include header.php at the top instead of including it in every page. however i've run into a problem. i run the following code to check if the visitor is logged in Code: <? if($this->vbulletin->hasSession()) { if i put this in the included header.php it throws an error: Using $this when not in object context in /home/ubuzznet/public_html/aaa/application/views/header.php on line 51 i can put the same code in the actual view file and the code works fine as it echos 'is logged in' Why would it not work in the included header file, is there a way around this? error in included file - El Forum - 08-28-2012 [eluser]johnpeace[/eluser] Have you tried: Code: $this->load->view('header'); error in included file - El Forum - 08-28-2012 [eluser]Uplift[/eluser] [quote author="johnpeace" date="1346161197"]Have you tried: Code: $this->load->view('header'); perfect thanks ![]() |