Welcome Guest, Not a member yet? Register   Sign In
How to pass the argument to the $lang?
#1

[eluser]maomaode[/eluser]
Hi,

The following code

Code:
$this->lang->line("required", "login name");

I used the validation_lang.php, and in the file defined:

Code:
$lang['required']         = "The %s field is requried.";

I hope the "login name" will replace the "%s", but what i got from the browser is

Quote:The %s field is requried.

How can I pass the argument to $lang? any documents for API?
#2

[eluser]maomaode[/eluser]
I found that i can use printf to work around the issue, but i guess there must have a more decent solution for this?




Theme © iAndrew 2016 - Forum software by © MyBB