Ben giriş gerektiren bir kaç sayfa var, bu nedenle bu sayfalara link tüm kontrolörleri ile başlar
$this->checkSession();
//...rest of the code
CheckSession aksi bir mesaj görüntüleyebilir ve denetleyicisi kod kalanı yürütülmesini durdurmak, hala canlı olduğunu oturumu doğrulamak gerekir:
function checkSession()
{
if (!$this->session->userdata('is_logged_in'))
{
//the session has expired!
$data['main'] = 'confirmation_message';
$data['title'] = "Session expired";
$this->load->vars($data);
$this->load->view('template');
exit();
}
}
. I was expecting these instructions to happen in sequence, but I only get a blank page. How can I make sure exit() gets executed only after all views are loaded?