CodeIgniter Forums
Array as language_key - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Array as language_key (/showthread.php?tid=70094)



Array as language_key - VigoKrumins - 02-19-2018

Hello.

Is it possible to use language_key as an array?

For example, my language file looks like this:

PHP Code:
$lang array_merge($lang, [
 
   'DASHBOARD' => 'Dashboard',

 
   'DATETIME' => [
 
       'MONTH' => [
 
           'JANUARY' => 'January',
 
       ],
 
   ],
]); 

Can I fetch $lang['DATETIME']['MONTH']['JANUARY'] using Language Helper's function lang()? Or CodeIgniter doesn't support language_key as an array and I've to make my own function?

Thanks,
Vigo


RE: Array as language_key - InsiteFX - 02-19-2018

It does not support it like that but you may be able to extend the library and helper.