开发者

Loading multiple language files in 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.


This example loads one class from the system library and one from application library.

$this->load->library(array( 'form_validation','form_validate_supplement'));


From the codeigniter documentation,

$this->lang->load(array('menu', 'text'), 'french');

Codeigniter documentation

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜