• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
language abbreviation in url

#1
Hello everybody,

I am working with codeigniter 4. I have a problem.
how can i recognize language abbreviation in url.

with
PHP Code:
$routes->get('{locale}/books''App\Books::index'); 

I tried but the problem is the following.

1. for all routes {locale} must be defined.
2. without language abbreviation the controller is not found.
3. $routes->setAutoRoute(true); no longer works.

it has to work like this:
when user enters the URL:
www.domain.com requires its browser language to be recognized and redirected to www.domain.com/en/

and if user enters the URL www.domain.com/de/ the locale must be changed in German.

this must work as well:
http://www.domain.com/contoller/method redirect to http://www.domain.com/en/contoller/method

I look forward to your suggestions
thanks
Reply


Messages In This Thread
language abbreviation in url - by arassaff - 04-23-2019, 09:45 PM
RE: language abbreviation in url - by includebeer - 04-24-2019, 05:28 AM
RE: language abbreviation in url - by arassaff - 04-24-2019, 09:55 AM
RE: language abbreviation in url - by futureisnow - 09-23-2019, 02:01 PM
RE: language abbreviation in url - by ciadmin - 09-23-2019, 02:11 PM
RE: language abbreviation in url - by mintwint - 09-26-2019, 12:16 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme ¬© 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.