Welcome Guest, Not a member yet? Register   Sign In
Menus and Other
#11

[eluser]Gewa[/eluser]
[quote author="wiredesignz" date="1209228671"]$uri->segment(1) will equal the identifier because it is added from $config() anyway, So use whichever suits.[/quote]



Code:
function test(){
        $lang=$this->uri->segment(1);
        echo $lang;
        $language=$config->item(’language’);
        echo $language;
        }


I tried both.
First gives such problem, that if people go to mysite.com/catalog (without any language abrreviation) then it gives $lang=catalog, which is quite problem.

second gives that the error described in my least post.


Message: Undefined variable: config

I would like to use second way, not to have problem when the site is in default mode without abbreviation..
#12

[eluser]Gewa[/eluser]
now i changed code to



$language=$this->config->item(language);

it gives right english but

Message: Use of undefined constant language - assumed 'language'
#13

[eluser]wiredesignz[/eluser]
$this->config->item('language'); don't forget its a string value.
#14

[eluser]Gewa[/eluser]
[quote author="wiredesignz" date="1209226733"]The $config->item{’language_abbr’) will contain the currently selected identifier and $config->item{’language’) will contain the currently selected language name.[/quote]


OK. I did it. With the string problem, just to say, WHAT A DUMMIE AM I.


Now its such problem. When I go to mysite.com/de/catalog/test/ See Function test above.


its showing de,english




Theme © iAndrew 2016 - Forum software by © MyBB