Welcome Guest, Not a member yet? Register   Sign In
passing variables to lang file
#1

[eluser]blorriman[/eluser]
I must be missing something here. I'm trying to pass a variable to a lang file using
Code:
//controller
$msg_data = 'put something here';
$data['message'] = $this->lang->line('my_lang-test', $msg_data);
$this->load->view('test/test-lang', $data);

//my_lang file
$lang['my_lang-test'] = 'This is my data = %s';

//view
echo $message;

But this is what I get :
This is my data = %s

What do I need to do to pass the $msg_data to the lang file?


Messages In This Thread
passing variables to lang file - by El Forum - 05-07-2011, 05:57 PM
passing variables to lang file - by El Forum - 05-07-2011, 07:31 PM
passing variables to lang file - by El Forum - 05-07-2011, 08:56 PM
passing variables to lang file - by El Forum - 02-24-2012, 10:02 PM



Theme © iAndrew 2016 - Forum software by © MyBB