Welcome Guest, Not a member yet? Register   Sign In
Load language file automatically
#1

[eluser]Assim[/eluser]
Here's my problem, I have a header and footer and my pages are using the template parser along with the other page fragements, and I'm also using the i18n library for internationalization, but the mainthing is there are some standard lines which all pages are using in the header and footer, how do I call these lines automatically and letting them get parsed. For the time being, I'm passing this in the controller:
Quote:$data['TextDirection'] = $this->lang->line('TextDirection');
$data['Left'] = $this->lang->line('Left');
$data['Right'] = $this->lang->line('Right');
$data['WebsiteName'] = $this->lang->line('WebsiteName');
$data['Font'] = $this->lang->line('Font');

I used something like this in the header view:
Quote:<html dir="{TextDirection}">
...
...

I tried using a pre_controller hook by putting them in a function called Language and made the hook call it. But I got one error with $this. Any solution?

I just want the above lines to be passed to my header and footer without rewriting them in every controller.

Does anybody know what to do?


Messages In This Thread
Load language file automatically - by El Forum - 02-21-2010, 08:51 AM
Load language file automatically - by El Forum - 02-21-2010, 09:30 AM
Load language file automatically - by El Forum - 02-21-2010, 10:26 AM
Load language file automatically - by El Forum - 02-21-2010, 11:30 AM
Load language file automatically - by El Forum - 02-21-2010, 11:32 AM
Load language file automatically - by El Forum - 02-21-2010, 12:34 PM
Load language file automatically - by El Forum - 02-21-2010, 02:48 PM
Load language file automatically - by El Forum - 02-22-2010, 02:19 AM



Theme © iAndrew 2016 - Forum software by © MyBB