Welcome Guest, Not a member yet? Register   Sign In
One if statement to rule them all
#5

[eluser]bretticus[/eluser]
You could still extend Controller, but it's also as easy as:
Code:
class something extends Controller {
    function something() {
        parent::Controller();
    }

    function main() {
        $this->_protect();
        $data['username'] = $this->session->userdata('email');
        $data['firstN'] = $this->session->userdata('first_name');
        $data['lastN'] = $this->session->userdata('last_name');
        $data['city'] = $this->session->userdata('city');
        $data['state'] = $this->session->userdata('state');
        $this->load->view('mrmain/includes/header_view');
        $this->load->view('admin/main_view', $data);
        $this->load->view('mrmain/includes/footer_view');
            //// moving on...
    }

    function _protect() {
        if($this->session->userdata('logged_in') === FALSE) {
            redirect('/');
            exit;
        }
    }
    
}


Messages In This Thread
One if statement to rule them all - by El Forum - 09-08-2009, 06:36 PM
One if statement to rule them all - by El Forum - 09-08-2009, 07:43 PM
One if statement to rule them all - by El Forum - 09-08-2009, 07:50 PM
One if statement to rule them all - by El Forum - 09-08-2009, 08:08 PM
One if statement to rule them all - by El Forum - 09-08-2009, 08:15 PM
One if statement to rule them all - by El Forum - 09-09-2009, 12:10 AM
One if statement to rule them all - by El Forum - 09-09-2009, 01:14 AM



Theme © iAndrew 2016 - Forum software by © MyBB