CodeIgniter不加载我的lang文件 [英] CodeIgniter not loading my lang file
问题描述
我有控制器,并有一个函数调用 password
。我有电子邮件形式:
I have controller and there is a function which calls password
. There I have email form:
$this->email->from('system@domain.us', "domain.us");
$this->email->to($user_data['email']);
$this->email->subject(lang('users_validations_passwordemail_title'));
$this->email->message(lang('users_validations_passwordemail_hi').", ". ucfirst(strtolower($userInfo[0]['username'])) .lang('users_validations_passwordemail_text'). $user_data['random_string'] ."");
$this->email->send();
并且在控制器功能中我有:
and in the controller contructor function I have:
$this->lang->load('controllers', $this->session->userdata('session_lang'));
但是当我尝试发送消息时,我收到此消息:
but when I tried to send message I've got this message:
Unable to load the requested language file: language/france/email_lang.php
所以如何使用它?为什么我有这个错误?如何修复?
so how tu use it? why i've got this error? how to fix it?
BTW - 我试图使用 lang('users_validations_passwordemail_title')
形式),并为我工作。
BTW - I tried to use lang('users_validations_passwordemail_title')
simple (not in email form) and that worked for me..
推荐答案
好吧,你正在加载一个不存在的文件。如果你有一个法语语言文件夹,你必须有email_lang.php文件与您需要的数据。在这种情况下,您需要的语言键
Well, you are loading a file which does not exist. If you have a france language folder, you have to have email_lang.php file in it with your required data. In this case, your required language key
这篇关于CodeIgniter不加载我的lang文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!