Why adding a CodeIgniter constructor producing error 500
Hello everyone I have a site controller code as below..... when I try to execute this code I get a weird problem, If I take out the __construct() function everything works pretty well for me, but, as soon as I add that constructor function I get the error 500 internal server error can any one help me out ??
<?php
class site extends CI_Controller
{
function __construct()
{
parent::CI_Controller();
$this->Logged_in();
}
function after_logging()
{
$this->load->view('home');
}
function Logged_in()
{
$is_logged_in = $this->session->userdata('is_logged_in');
if(!开发者_StackOverflowisset($is_logged_in)|| $is_logged_in != TRUE)
{
die();
}
}
}
Is this CI 2.0?
In that case, use this for the constructor:
public function __construct()
{
parent::__construct();
// your code
}
精彩评论