Welcome Guest, Not a member yet? Register   Sign In
Issue with the langauge class
#1

[eluser]Jona[/eluser]
Hi all,
I'm trying to implement a test of the langauge class. I have the following setup

application/controllers/test.php
Code:
class Test extends Controller {

        function Welcome()
        {
                parent::Controller();
        }

        function index()
        {
        $this->lang->load('login','welsh');
        }
}

Then in application/language/welsh/login_lang.php
Code:
$lang['welcome'] = "Croeso";

When I navigate to
http://192.168.238.131/index.php/test/index
I get the following output:
Code:
$lang['welcome'] = "Croeso";
Which just seems to be echoing the langauge file rather than loading it in and then waiting until I call the loadline function. Have I done something wrong here? is it because I'm doing it in the controller rather than the view?

Any help much appreciated..

Cheers
Jona
#2

[eluser]Jona[/eluser]
Easy fix - I forgot to add the
<?php
and
?>
tags to my language files. Doh!

Jona




Theme © iAndrew 2016 - Forum software by © MyBB