<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class MY_Controller extends CI_Controller
{
    protected function render($view, $data = array())
    {
        $data['content'] = $this->load->view($view, $data, TRUE);
        $this->load->view('template/app', $data);
    }
}

class Auth_Controller extends MY_Controller
{
    public function __construct()
    {
        parent::__construct();

        if (!$this->session->userdata('is_logged_in')) {
            redirect('login');
        }
    }
}
