Welcome Guest, Not a member yet? Register   Sign In
redirect() does not redirects
#5

(09-06-2020, 11:42 PM)chenzen Wrote: You can improve the approach to your design, and completely avoid "en/home" etc. First ensure all text on your pages are actually from language blocks, then have translations for the languages you wish to support. Then automatically retrieve a users locale like this https://codeigniter.com/user_guide/outgo...ent-locale and automatically serve the user in his/her language or default if not available.
Interesting solution - to use different locales in the same URL depending on user. Maybe I've missed it when read the docs Confused 
And even "setLocale()" may call in filter, as said before, when user is authorized Cool

(09-06-2020, 11:42 PM)chenzen Wrote: For the redirect, you can create a helper function like this, and use it as you were using redirect in CI3.

if
(!function_exists('go')){
    function go($route){
        $str = base_url().'/'.$route;
      header("Location: $str");
      exit();
    }
}
Alternatively, it may be. Thanks!
Reply


Messages In This Thread
redirect() does not redirects - by T.O.M. - 09-06-2020, 11:09 AM
RE: redirect() does not redirects - by SteeveDroz - 09-06-2020, 09:48 PM
RE: redirect() does not redirects - by chenzen - 09-06-2020, 11:42 PM
RE: redirect() does not redirects - by T.O.M. - 09-07-2020, 03:36 AM
RE: redirect() does not redirects - by T.O.M. - 09-07-2020, 03:21 AM



Theme © iAndrew 2016 - Forum software by © MyBB