Welcome Guest, Not a member yet? Register   Sign In
18n problemm with paramaters
#1

[eluser]Unknown[/eluser]
I have integrated in my project Internationalization (i18n) library, and I have some problems with Ist an second segments. I have routes:

Code:
$route['^(en|ru)/services'] = 'services';
$route['^(en|ru)/services/(:any)/(:any)'] = 'services/showcat/$1/$2';
$route['^(en|ru)/services/(:any)'] = 'services/showcat/$1';
some links work perfectly lake site.pc/en/services bat when I enter site.pc/en/services/private_service or site.pc/en/services/private_service/idart I can't get params what I ned, it given to me that

Code:
public function showcat($idCat, $idart = '') {
        echo ' id: ' . $idCat;      // en

        //and for http://site.pc/en/services/private_service/3
        echo ' idart: ' . $idServise;     // empty
}
Why I can't get idCat = private_service and idart = 3

if I add in array controller services to not localized

// special URIs (not localized) var $special = array ( "dashboard", "settings", "services" ); in class MY_Lang then i get good parameters get idCat = private_service and idart = 3

To get my parameters I need to ad in routes 3rd params

Code:
$route['^(en|ru)/services/(:any)/(:any)/(:any)'] = 'services/showcat/$1/$2/$3';
and in function

Code:
//url is site.pc/en/services/private_service/3/anyvars    
function showcat($idCat, $idart = '', $k = '') {
    //idCat is en
    //idart is private_service
    //k is 3
    }
Why firs parameter is get lang
#2

[eluser]Unknown[/eluser]
I fix it!
Problem is in routs
Code:
$route['^(en|ru)/services/(:any)'] = 'services/showcat/$1';
I think first parameter is language. I edit my routs and now is work fine
Code:
$route['^(en|ru)/services/(:any)'] = 'services/showcat/$2';




Theme © iAndrew 2016 - Forum software by © MyBB