在Codeigniter中使用语言类时,图像不断消失

时间:2016-02-07 15:22:42

标签: php codeigniter codeigniter-3

您最近开始编码,我有这个控制器,目前转换为不同的语言。

问题在于图像。选择语言后,页面将切换为所需语言并进行翻译,但不会显示任何图像。

public function __construct() {
    parent::__construct();
    $this->load->library('session');
}

public function index() {
    $this->lang->load('en_homepage_english_lang', 'English');

    $sess_data = array();
    $sess_data['default'] = 'english';
    $sess_data['slider_text_1']     = $this->lang->line('slider_text_1');
    $sess_data['slider_text_2']     = $this->lang->line('slider_text_2');

    $this->session->set_userdata('session_data', $sess_data);
    $data = $this->session->all_userdata();

    $data['title'] = "Vacation Rentals | Holiday Homes";
    $this->load->view('view', $data);
    }

public function select_language() {
    $language = $this->input->post('language');
    if ($language == 'english') {
    $data['selected'] = 'english';
    } else if ($language == 'english') {
    $data['selected'] = 'french';
    } else {
    $data['selected'] = 'Russian';

$this->lang->load('en_homepage_' . $language, $language);
$sess_data['select_lang'] = $this->lang->line('select_lang');
    $sess_data['default']           = $language;
    $sess_data['slider_text_1']     = $this->lang->line('slider_text_1');
    $sess_data['slider_text_2']     = $this->lang->line('slider_text_2');
    $sess_data['search_1']          = $this->lang->line('search_1');

$this->session->set_userdata('session_data', $sess_data);
$data = $this->session->all_userdata();

$this->load->view('view',$data);
}

我想知道我在这里做错了什么。

0 个答案:

没有答案