Answer the question
In order to leave comments, you need to log in
How to get site language code on CodeIgniter?
I am new to CodeIgniter.
Here is a demo that I 'm picking www.datingsoftware.ru/dating/demo.php
The site is multilingual (languages are added from the admin panel).
How can I get the value of the language selected by the user anywhere in the code?
Next, in PHP I will write the conditions for displaying something, depending on the selected language.
Answer the question
In order to leave comments, you need to log in
Try saving cookies with the user's language selected, and then process them.
Sessions, cookies
For example, sessions:
// загружаем библиотеку там, где надо или добавляем ее в autoload.php
$this->load->library('session');
// устанавливаем значение
$this->session->set_userdata('language', 'ru');
// получаем значение
$this->session->userdata('language');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question