CodeIgniter Forums
How to pass the argument to the $lang? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: How to pass the argument to the $lang? (/showthread.php?tid=2923)



How to pass the argument to the $lang? - El Forum - 08-30-2007

[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?


How to pass the argument to the $lang? - El Forum - 08-30-2007

[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?