L This method is used to set and obtain the current language definition when multiple languages are enabled. Call Format: L ('language variable '[, 'Language value']) L method is used to set and obtain the current language definition when multiple languages are enabled.
Call format:
L ('language variable '[, 'Language value'])
Set language variables
In addition to defining language variables using language packs, we can use the L method to dynamically set language variables, for example:
- L ('Lang _ var', 'Language defination ');
The definition of the replication code language is case insensitive, so the following is equivalent:
- L ('Lang _ var', 'Language defination ');
We recommend that you use uppercase to define language variables.
L The method supports batch setting of language variables, for example:
- $ Lang ['Lang _ var1'] = 'language Definition 1 ';
- $ Lang ['Lang _ var2'] = 'language definition 2 ';
- $ Lang ['Lang _ var3'] = 'language definition 3 ';
- L ($ lang );
Copy the code to set the lang_var1 lang_var2 and lang_var3 language variables.
[-More-]
Get language variables
- $ LangVar = L ('Lang _ var ');
Copy the code or:
- $ LangVar = L ('Lang _ var ');
If the parameter is null, the code is copied to obtain all the currently defined language variables (including in the language definition file ):
- $ Lang = L ();
Copy the code or use it in the template.
- {$ Think. lang. lang_var}
Copy the code to output the language definition.