<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Messages extends CI_Controller { function __construct(){ parent::__construct(); $this->load->library('ion_auth'); $this->load->library('session'); $this->load->database(); $this->load->helper('url'); } function index(){ if (!$this->ion_auth->logged_in()) { $this->load->view('auth/index'); } else { $this->load->view('messages'); } } }