[eluser]igul222[/eluser]
[quote author="WackyWebs.net" date="1201902614"]Solution Controller
Code:
class Example extends Controller {
function Example()
{
parent::Controller();
if($this->session->userdata('logged_in') != 'yes'){
$this->load->view('not_logged_in'); }
//logged in load other code
// the above code is loaded for ever function inside the controller
}
// your functions here
function index()
{
// index function here
}
}
Read the above comments and it should be self explanatory.[/quote]
Thanks! However, I need to actually prevent the code inside index() from being run. Example:
Code:
class Example extends Controller {
function Example()
{
parent::Controller();
if($this->session->userdata('logged_in') != 'yes'){
$this->load->view('not_logged_in'); }
//logged in load other code
// the above code is loaded for ever function inside the controller
}
// your functions here
function index()
{
//i really don't want this code to be run...
$this->db->insert('mytable',$some_dangerous_stuff);
$this->load->view('user_profile');
}
Is there any way to do that?