<?php if ( ! defined('BASEPATH')) exit('Direct access allowed');
 
class LanguageSwitcher extends CI_Controller
 
{
 
   public function __construct() {
 
       parent::__construct();
 
   }
 
   function switchLang($language = "") {
        $ci =& get_instance();
 
 
       $language = ($language != "") ? $language : "turkish";
 
       $this->session->set_userdata('site_lang', $language);
 
$cookie= array('name'   => 'site_lang', 'value'  =>$language, 'expire' => '86500',);
 $ci->input->set_cookie($cookie);
 


       redirect($_SERVER['HTTP_REFERER']);
 
   }
 
}