在CodeIgniter中加载多个语言文件 [英] Loading multiple language files in CodeIgniter
本文介绍了在CodeIgniter中加载多个语言文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我可以在CodeIgniter中为同一视图加载多个语言文件吗?
解决方案
b
$ b
这很简单。我刚刚加载两个文件与 $ this-> lang-> load()
。
$ this-> lang-> load(lang_file1);
$ this-> lang-> load(lang_file2);
然后在视图加载后,我可以使用两个文件中的字符串。但我不知道相同的字符串在不同的lang文件的后果。
我也看到了你甚至可以在CodeIgniter中加载多个视图。只需要连续加载它们,CodeIgniter将它们合并到一个视图。
Can I load multiple language files for the same view in CodeIgniter?
解决方案
ah...
Well it was pretty simple. I just loaded the two files with $this->lang->load()
.
$this->lang->load("lang_file1");
$this->lang->load("lang_file2");
Then after the view is loaded, I can use strings from the both files. But I'm not sure of the consequences of the same string being in different lang files.
I also saw that you can even load multiple views in CodeIgniter. Just have to load them consecutively and CodeIgniter will merge them into one view.
这篇关于在CodeIgniter中加载多个语言文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文