CodeIgniter Forums
Loading language files - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Loading language files (/showthread.php?tid=35108)



Loading language files - El Forum - 10-19-2010

[eluser]K-Fella[/eluser]
How come you can't load multiple language files using an array?
Code:
$this->lang->load(array('user', 'page'));

By the way, I think loading language files should be done using:
Code:
$this->load->language();

This (to me anyway) is more in keeping with the coding practices of CI.


Loading language files - El Forum - 10-19-2010

[eluser]danmontgomery[/eluser]
Code:
$this->load->language('user');
// or
$this->load->language(array('user','page'));



Loading language files - El Forum - 10-26-2010

[eluser]K-Fella[/eluser]
I never knew you could write it like that. I guess because nothing is mentioned in the user guide Smile


Loading language files - El Forum - 10-26-2010

[eluser]danmontgomery[/eluser]
http://ellislab.com/codeigniter/user-guide/libraries/loader.html

Quote:$this->load->lang('file_name')

This function is an alias of the language loading function: $this->lang->load()