Welcome Guest, Not a member yet? Register   Sign In
Language Type file
#1

[eluser]Ngulo[/eluser]
Hi all, i was wondering about this:

Can i use in my language file an associative array for all my words?

i know we can for sure use this in file language :
Code:
$lang['asd']='asd';
$lang['brb']='brb';

but what i'm wondering is if i can use something like this in languages files:
Code:
<?php
return array(
  'asd'=>'asd',
  'brb'=>'brb',
  etc etc...
);
?>
and how to return key values in the view?

thanks guys Wink
#2

[eluser]WanWizard[/eluser]
What are you trying to archieve?

A language file has to contain the $lang array, when you load a language file it gets included, and the contents of $lang will be stored in a language class variable. This is hardcoded.

As it is a standard PHP file, you can put code in there to manipulate the contents of the $lang array at runtime, you probably can even access CI (I haven't tried that).
#3

[eluser]Ngulo[/eluser]
thanks man i'm sorry for my english but i've just found what i was looking for directly into the user guide Tongue

sorry for banal question




Theme © iAndrew 2016 - Forum software by © MyBB