![]() |
if (!$logged_in) { $this->load->view('login'); } - 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: if (!$logged_in) { $this->load->view('login'); } (/showthread.php?tid=12024) |
if (!$logged_in) { $this->load->view('login'); } - El Forum - 10-02-2008 [eluser]bwuk[/eluser] Hi everyone, basically the title explains what it is I'm trying to do....but here's the extra info: I've extended Controller with the following: Code: class Public_Controller extends Controller { Basically, if someone isn't logged in, I want to display the view 'home' and stop everything there. I've also extended Output with MY_Output that deals with page headers and 'skins'. My site uses 'skins', which are basic templates. Here's one for example: 'skin.php' Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> So, MY_Output deals with: <page_title /> - set in each Controller with $this->page_title <header_css /> - set in each Controller with $this->header_css[] (an array of CSS includes) <output /> - The standard output <header_js /> - set in each Controller with $this->header_js[] (an array of JS includes) How can I get CI to load the home view and then stop processing - i.e. just output the view with the relevant headers from MY_Output? If I try $this->output->get_output(), it just returns the standard output (what would replace <output /> in my skin). Does that make any sense? ![]() Thanks bwuk |