Welcome Guest, Not a member yet? Register   Sign In
using loaded language file inside controller, possible?
#1

[eluser]moonbeetle[/eluser]
In my constructor I load the language file according to the user's preference like this:
Code:
// Load language file
$this->lang->load('products', $this->db_session->userdata('lang'));

in the language file I'm loading I have an entry:
Code:
$lang['next_link'] = 'Volgende';
("Volgende" means "Next" in Dutch)

This works fine and when I load a view file I can use data from my loaded language file. So the controller is perfectly capable of loading the language file and passing the data to the view file. However, what I can't do or can't figure out is how to use the loaded language data directly inside the controller. Why would I want to do this? For setting the config values for pagination where language dependancy is needed for instance.

This works (obviously):
Code:
$config['next_link'] = 'Next'

But this doesn't:
Code:
$config['next_link'] = $this->lang->line('next_link');
nor will this:
Code:
$config['next_link'] = $lang['next_link'];

Does anyone have a solution for this?


Messages In This Thread
using loaded language file inside controller, possible? - by El Forum - 08-09-2007, 04:30 AM
using loaded language file inside controller, possible? - by El Forum - 08-09-2007, 05:12 AM
using loaded language file inside controller, possible? - by El Forum - 08-09-2007, 04:24 PM
using loaded language file inside controller, possible? - by El Forum - 08-09-2007, 07:26 PM
using loaded language file inside controller, possible? - by El Forum - 08-09-2007, 07:49 PM



Theme © iAndrew 2016 - Forum software by © MyBB